Files
GateDge2023_ljy/MonthlyProductionSchedule/BarItemClickEventPlugIn.cs

59 lines
2.2 KiB
C#
Raw Normal View History

2023-12-17 11:37:43 +08:00
using Kingdee.BOS.App.Data;
using Kingdee.BOS;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
2023-12-15 09:08:09 +08:00
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn;
2023-12-17 11:37:43 +08:00
using Kingdee.BOS.Model.Report;
using Kingdee.BOS.Orm.DataEntity;
2023-12-15 09:08:09 +08:00
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
2023-12-17 11:37:43 +08:00
using System.Data;
2023-12-15 09:08:09 +08:00
using System.Linq;
2023-12-17 11:37:43 +08:00
using System.Runtime.InteropServices.ComTypes;
using System.Security.Cryptography;
2023-12-15 09:08:09 +08:00
namespace MonthlyProductionSchedule
{
[Description("生产计划表-点击事件"), HotUpdate]
public class BarItemClickEventPlugIn : AbstractSysReportPlugIn
{
public override void ButtonClick(ButtonClickEventArgs e)
{
if (e.Key.EqualsIgnoreCase("FSaveDataButton"))
{
base.ButtonClick(e);
2023-12-17 11:37:43 +08:00
var reportModel = this.Model as SysReportModel; //简单帐表对应的Model
this.View.ShowMessage("保存数据会覆盖历史数据,是否继续?", MessageBoxOptions.OKCancel, new Action<MessageBoxResult>(result =>
{
if (result == MessageBoxResult.OK)
{
var tableName = this.SysReportView.Model.DataSource.TableName;
var para = new List<SqlParam>();
var year = reportModel.DataObject["DataHoldYear"].Long2Int();
var month = reportModel.DataObject["DataHoldMonth"].Long2Int();
para.Add(new SqlParam("@tableName", KDDbType.String, tableName));
para.Add(new SqlParam("@FRECORDDATE", KDDbType.DateTime, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
para.Add(new SqlParam("@FRECORDYEAR", KDDbType.Int64, year));
para.Add(new SqlParam("@FRECORDMONTH", KDDbType.Int64, month));
var res = DBUtils.ExecuteStoreProcedure(this.Context, "PROC_PPL_SaveCurrentData", para);
reportModel.DataObject["DataBDStatu"] = 1;
}
}));
2023-12-15 09:08:09 +08:00
return;
}
}
}
}