李狗蛋 569ca39775 1
2025-05-13 14:14:51 +08:00

42 lines
1.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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开头则明细物联网卡使用年份字段必填")
);
}
}
}
}
}
}
}