1
This commit is contained in:
41
SAL_ORDER/SaveWL.cs
Normal file
41
SAL_ORDER/SaveWL.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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开头,则明细物联网卡使用年份字段必填")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user