123
This commit is contained in:
89
VapeEZDLL/YSSJLRCB_FXB/YuSuanShiJiLiRunFenXiBiao.cs
Normal file
89
VapeEZDLL/YSSJLRCB_FXB/YuSuanShiJiLiRunFenXiBiao.cs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
using Kingdee.BOS.Core.Bill.PlugIn;
|
||||||
|
using Kingdee.BOS.Core.DynamicForm;
|
||||||
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||||
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||||
|
using Kingdee.BOS.Core.Metadata.EntityElement;
|
||||||
|
using Kingdee.BOS.ProductModel;
|
||||||
|
using Kingdee.BOS.ServiceHelper;
|
||||||
|
using Kingdee.BOS.Util;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VapeEZDLL.YSSJLRCB_FXB
|
||||||
|
{
|
||||||
|
[Description("预算利润与实际利润对比分析"), HotUpdate]
|
||||||
|
public class YuSuanShiJiLiRunFenXiBiao : AbstractDynamicFormPlugIn
|
||||||
|
{
|
||||||
|
//重写点击按钮函数
|
||||||
|
public override void AfterButtonClick(AfterButtonClickEventArgs e)
|
||||||
|
{
|
||||||
|
base.AfterButtonClick(e);
|
||||||
|
//if (e.BarItemKey.Equals("F_HuoQu", StringComparison.OrdinalIgnoreCase))
|
||||||
|
//{
|
||||||
|
// // 弹出确认框
|
||||||
|
// View.ShowMessage("预算利润与实际利润对比分析");
|
||||||
|
// //给单据头,备注赋值,你好
|
||||||
|
// //this.View.Model.SetValue("FNote", "你好");
|
||||||
|
//}
|
||||||
|
// 弹出确认框
|
||||||
|
if (e.Key == "F_HUOQU")
|
||||||
|
{
|
||||||
|
SetRows();
|
||||||
|
}
|
||||||
|
//View.ShowMessage("预算利润与实际利润对比分析"+ e.Key);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DataChanged(DataChangedEventArgs e)
|
||||||
|
{
|
||||||
|
base.DataChanged(e);
|
||||||
|
if (e.Field.Key==("F_Date"))
|
||||||
|
{
|
||||||
|
//string now = DateTime.Now.Date.ToString("yyyy-MM-dd");
|
||||||
|
//this.View.Model.SetValue("F_DATE", now);
|
||||||
|
|
||||||
|
SetRows();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRows()
|
||||||
|
{
|
||||||
|
var FEntity = this.View.Model.DataObject;
|
||||||
|
//FEntity["F_DATE"] = now;
|
||||||
|
//View.ShowMessage("预算利润与实际利润对比分析" + FEntity["F_DATE"].ToString());
|
||||||
|
if (FEntity["F_DATE"]==null)
|
||||||
|
{
|
||||||
|
View.ShowErrMessage("请先选择时间");
|
||||||
|
}
|
||||||
|
DateTime days = DateTime.Parse(FEntity["F_DATE"].ToString());
|
||||||
|
this.View.Model.DeleteEntryData("FEntity");
|
||||||
|
this.View.Model.SetValue("F_ZhangQi", days.ToString("yyyy-MM"));
|
||||||
|
string sql = $@"exec RP_YuSuanShiJiLiRun_FenXi {days.Year}, {days.Month}";
|
||||||
|
var dateList = DBServiceHelper.ExecuteDynamicObject(this.Context, sql, null, null, CommandType.Text, null);
|
||||||
|
if (dateList != null && dateList.Count > 0)
|
||||||
|
{
|
||||||
|
int indexi = 0;
|
||||||
|
foreach (var item in dateList)
|
||||||
|
{
|
||||||
|
this.View.Model.CreateNewEntryRow("FEntity");
|
||||||
|
this.View.Model.SetValue("F_XM", item["F_XM"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BQYSE", item["BenQiYuSuan"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BQSJJE", item["F_BQSJJE"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BQYSSJJECY", item["F_BQYSSJJECY"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BNYSJE", item["F_BNYSJE"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BNSJJE", item["F_BNSJJE"], indexi);
|
||||||
|
this.View.Model.SetValue("F_BNYSSJCY", item["F_BNYSSJCY"], indexi);
|
||||||
|
|
||||||
|
indexi++;
|
||||||
|
}
|
||||||
|
this.View.UpdateView("FEntity");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user