添加项目文件。
This commit is contained in:
74
aoyuPlugIn/皇顶/hd_xsdd_xsddps.cs
Normal file
74
aoyuPlugIn/皇顶/hd_xsdd_xsddps.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core.Bill.PlugIn;
|
||||
using Kingdee.BOS.Core.Bill.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Metadata;
|
||||
using Kingdee.BOS.Core.Metadata.EntityElement;
|
||||
using Kingdee.BOS.Core.SqlBuilder;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using System.Data;
|
||||
using System.Collections;
|
||||
|
||||
namespace aoyuPlugIn
|
||||
{
|
||||
[Description("销售订单评审")]
|
||||
public class hd_xsdd_xsddps : AbstractBillPlugIn
|
||||
{
|
||||
public override void BeforeSave(BeforeSaveEventArgs e)
|
||||
{
|
||||
|
||||
base.BeforeSave(e);
|
||||
//F_HDIN_DDPS
|
||||
//订单日期
|
||||
string ddrq = this.View.Model.GetValue("FDate").ToString();
|
||||
|
||||
////取表体最大行数
|
||||
//string FEntity_nm = "T_SAL_ORDERENTRY";
|
||||
//int tol = this.Model.GetEntryRowCount(FEntity_nm);
|
||||
//计算评审天数
|
||||
try
|
||||
{
|
||||
string ORM_NM = "SaleOrderEntry";//你的单据体ORM实体名
|
||||
DynamicObject obj = this.Model.DataObject;
|
||||
DynamicObjectCollection rows = obj[ORM_NM] as DynamicObjectCollection;
|
||||
|
||||
foreach (var r in rows)
|
||||
{
|
||||
//FDeliveryDate DeliveryDate
|
||||
string yhrq = r["DeliveryDate"].ToString();
|
||||
//交货期和下单日期的相差天数
|
||||
string xcts = getRQC(Convert.ToDateTime(ddrq), Convert.ToDateTime(yhrq));
|
||||
r["F_HDIN_SCTS"] = xcts;
|
||||
//string sczq= r["F_Hdin_SCZQ"].ToString();
|
||||
//string scts = r["F_HDIN_SCTS"].ToString();
|
||||
//string psts = r["F_HDIN_PSTS"].ToString();
|
||||
this.View.ShowMessage(yhrq);
|
||||
string sl = r["F_FQ1TY1"].ToString();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { this.View.ShowMessage("组合表数据时发生错误为:" + ex.Message); }
|
||||
//this.View.ShowMessage(ddrq);
|
||||
//e.Cancel = true;
|
||||
}
|
||||
//计算日期差
|
||||
string getRQC(DateTime tm1,DateTime tm2)
|
||||
{
|
||||
int ts = 0;
|
||||
TimeSpan tsc = tm2.Subtract(tm1);
|
||||
ts = tsc.Days + 1;
|
||||
return ts.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user