From f0ad1863506acbeebd08918207651f9ecf59d48a Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Mon, 25 Dec 2017 14:57:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/B3QingDaoWanFu.csproj | 2 +- .../BLActions/SaleForecastBLAction.cs | 47 +++++++++++++++++++ .../config/plugins/B3QingDaoWanFu.plugin | 1 + 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 B3QingDaoWanFu/BLActions/SaleForecastBLAction.cs diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index 2f78b47..533dcb2 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -126,9 +126,9 @@ Customer_version.cs + - diff --git a/B3QingDaoWanFu/BLActions/SaleForecastBLAction.cs b/B3QingDaoWanFu/BLActions/SaleForecastBLAction.cs new file mode 100644 index 0000000..69fb177 --- /dev/null +++ b/B3QingDaoWanFu/BLActions/SaleForecastBLAction.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.BusinessInterfaces; +using TSingSoft.WebPluginFramework.BIPlugins.BLEvents; + +namespace BWP.B3QingDaoWanFu.BLActions +{ + public class SaleForecastBLAction : IBLMethodAction + { + public void Execute(IDmoContext context, object dmo, object parameter) + { + //时 分 + var bill = dmo as SaleForecast; + var shi =Convert.ToInt32(parameter.ToString().Split(',')[0]); + var fen = Convert.ToInt32(parameter.ToString().Split(',')[1]); + + var 创建日期 = bill.CreateTime.Value.Date; + var 接货日期 = bill.DeliveryTime.Value.Date; + if (创建日期 == 接货日期) + { + if (DateTime.Now > new DateTime(接货日期.Year, 接货日期.Month, 接货日期.Day, shi, fen, 0)) + { + throw new Exception("超时间订货,请于"+shi+"时"+fen+"分 前订货"); + } + } + else if(创建日期> 接货日期) + { + throw new Exception("创建日期不能大于提货日期"); + } + + } + + public string Name { + get { return "B3QingDaoWanFu.销售预报审核控制时间"; } + } + public string Description { + get { return "销售预报审核控制时间"; } + } + public IList Features + { + get { return new List(); } + } + } +} diff --git a/WebFolder/config/plugins/B3QingDaoWanFu.plugin b/WebFolder/config/plugins/B3QingDaoWanFu.plugin index d808445..f039039 100644 --- a/WebFolder/config/plugins/B3QingDaoWanFu.plugin +++ b/WebFolder/config/plugins/B3QingDaoWanFu.plugin @@ -4,6 +4,7 @@ +