添加项目文件。
This commit is contained in:
49
SAL_ORDER/DataChage.cs
Normal file
49
SAL_ORDER/DataChage.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GZ_LTHPilot_ORDER.SAL_ORDER
|
||||
{
|
||||
[Description("[表单插件]销售订单--根据合同类型变化,更新备货组织"), HotUpdate]
|
||||
public class DataChage : AbstractDynamicFormPlugIn
|
||||
{
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
base.DataChanged(e);
|
||||
|
||||
if (e.Field.Key == "F_Ordercategory")
|
||||
{
|
||||
string Sql = string.Format(@"SELECT FDATAVALUE FROM T_BAS_ASSISTANTDATAENTRY_L WHERE FENTRYID = '{0}'", e.NewValue.ToString());
|
||||
var SqlDS = DBUtils.ExecuteDynamicObject(this.Context, Sql);
|
||||
if (SqlDS.Count > 0)
|
||||
{
|
||||
if (SqlDS[0]["FDATAVALUE"].ToString().Contains("充电桩"))
|
||||
{
|
||||
this.View.Model.SetValue("F_SaleOrgId", "100303");
|
||||
}
|
||||
else if (SqlDS[0]["FDATAVALUE"].ToString().Contains("储能"))
|
||||
{
|
||||
this.View.Model.SetValue("F_SaleOrgId", "1467475");
|
||||
}
|
||||
else if (SqlDS[0]["FDATAVALUE"].ToString().Contains("服务"))
|
||||
{
|
||||
var FSaleOrgId = this.View.Model.GetValue("FSaleOrgId");
|
||||
this.View.Model.SetValue("F_SaleOrgId", FSaleOrgId);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.View.Model.SetValue("F_SaleOrgId", "100302");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.View.UpdateView("F_SaleOrgId");
|
||||
}
|
||||
}
|
||||
}
|
||||
28
SAL_ORDER/SaveF_VRYF_Combo-lsn.cs
Normal file
28
SAL_ORDER/SaveF_VRYF_Combo-lsn.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GZ_LTHPilot_ORDER.SAL_ORDER
|
||||
{
|
||||
[Description("服务插件:销售订单根据纸质合同号变更销售类型"), HotUpdate]
|
||||
public class SaveF_VRYF_Combo_lsn : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
|
||||
{
|
||||
base.AfterExecuteOperationTransaction(e);
|
||||
foreach (var Row in e.SelectedRows)
|
||||
{
|
||||
// 获取单据信息
|
||||
var Billobj = Row.DataEntity;
|
||||
//sql
|
||||
SqlManage.SqlManage.UpdateSal_OrderF_VRYF_Combo_lsn(this.Context, Convert.ToString(Billobj["Id"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
SAL_ORDER/SaveWL.cs
Normal file
42
SAL_ORDER/SaveWL.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GZ_LTHPilot_ORDER.SAL_ORDER
|
||||
{
|
||||
[Description("服务插件:销售订单根据物料编码做判断"), HotUpdate]
|
||||
public class SaveWL : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
|
||||
{
|
||||
base.BeforeExecuteOperationTransaction(e);
|
||||
foreach (var Row in e.SelectedRows)
|
||||
{
|
||||
//获取单据信息
|
||||
var Billobj = Row.DataEntity;
|
||||
//根据订单FID
|
||||
var sqls = SqlManage.SqlManage.SaveOrder_GZTH(this.Context, Convert.ToString(Billobj["Id"]));
|
||||
if (sqls != null)
|
||||
{
|
||||
foreach (var sql in sqls)
|
||||
{
|
||||
if (Convert.ToInt32(sql["SUMWL"]) == 0)
|
||||
{
|
||||
e.Cancel = true;
|
||||
throw new Exception(
|
||||
|
||||
string.Format(@"物料编码J.06.00开头,且订单日期大于2025/05/10,则明细物联网卡使用年份字段必填")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user