From 6601af881c0cbc9a6f5f60ddc0e3cf3ba7f265b7 Mon Sep 17 00:00:00 2001 From: duanluohua Date: Fri, 1 Dec 2017 17:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.137532?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj | 3 + .../Pages/B3YunKen/Overlays/OrderEdit_Ext.cs | 65 +++++++++++++++++ BWP.B3_YunKen.Web/PluginClass.cs | 4 ++ BWP.B3_YunKen/BWP.B3_YunKen.csproj | 2 + BWP.B3_YunKen/Properties/AssemblyInfo.cs | 6 +- BWP.B3_YunKen/Rpcs/DriverRpc.cs | 69 +++++++++++++++++++ 6 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs create mode 100644 BWP.B3_YunKen/Rpcs/DriverRpc.cs diff --git a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj index 267b560..51ff1ab 100644 --- a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj +++ b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj @@ -76,6 +76,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind diff --git a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs new file mode 100644 index 0000000..e8cf97e --- /dev/null +++ b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs @@ -0,0 +1,65 @@ +using BWP.Web.Pages.B3Sale.Bills.Order_; +using BWP.Web.Layout; +using TSingSoft.WebControls2; + +namespace BWP.Web.Pages.B3YunKen.Overlays +{ + public class OrderEdit_Ext:OrderEdit + { + protected override void AddCarDriverInfoConfig(LayoutManager layOutManager, AutoLayoutConfig config) + { + layOutManager.Add("DriverIDCard", new DFChoiceBox(mDFInfo.Fields["DriverIDCard"])); + //layOutManager.Add("DriverCard",new DFTextBox()); + config.Add("DriverIDCard"); + config.Add("Driver_ID"); + config.Add("DriverCard"); + config.Add("DriverPhone"); + config.Add("Car_ID"); + config.Add("EngineNumber"); + config.Add("VinNO"); + config.Add("HandcarNumber"); + } + + protected override void AddYunKenConfig(LayoutManager layOutManager, AutoLayoutConfig config) + { + config.Add("FreightUnitPrice"); + config.Add("FreightPrice"); + config.Add("FreightBear"); + } + + protected override void AddLayOutManagerScript(LayoutManager layoutPanel)//联动下拉 + { + base.AddLayOutManagerScript(layoutPanel); + var idCard = layoutPanel.EnsureInputControlCreated("DriverIDCard");//司机身份证号下拉 + var carid = layoutPanel.EnsureInputControlCreated("Car_ID");//运输车辆下拉 + //选择司机身份证号带出驾驶证号和司机名字 + if (idCard != null) + { + idCard.OnClientSelected += @"var idCard = this.front.value; +simpleRestCall('/MainSystem/B3_YunKen/Rpcs/DriverRpc/GetDriverInfoByIDCard',[idCard], +function(result){ +if(result!=null){ +__DFContainer.getControl('Driver_ID').fill(result.ID,result.Name); +__DFContainer.setValue('DriverCard',result.DriverCard); +__DFContainer.setValue('DriverPhone',result.Telephone); +} +},{ });"; + } + //选择运输车辆带出发动机号、车架号、挂车车牌号 + if (carid!=null) + { + carid.OnClientSelected += @"var carid = this.front.value; +simpleRestCall('/MainSystem/B3_YunKen/Rpcs/DriverRpc/GetCarInfoByCarID',[carid], +function(result){ +if(result!=null){ +__DFContainer.setValue('EngineNumber',result.EngineNumber); +__DFContainer.setValue('VinNO',result.VinNO); +__DFContainer.setValue('HandcarNumber',result.HandcarNumber); +} +},{ });"; + } + } + + + } +} diff --git a/BWP.B3_YunKen.Web/PluginClass.cs b/BWP.B3_YunKen.Web/PluginClass.cs index ef4e7f9..f482a7a 100644 --- a/BWP.B3_YunKen.Web/PluginClass.cs +++ b/BWP.B3_YunKen.Web/PluginClass.cs @@ -1,6 +1,9 @@ using BWP.B3Sale; using TSingSoft.WebPluginFramework; using BWP.B3UnitedInfos; +using TSingSoft.WebPluginFramework.Pages; +using BWP.Web.Pages.B3Sale.Bills.Order_; +using BWP.Web.Pages.B3YunKen.Overlays; namespace BWP.B3_YunKen.Web { @@ -14,6 +17,7 @@ namespace BWP.B3_YunKen.Web GlobalFlags.On(B3SaleConsts.Flags.DriverNameAllowSame); GlobalFlags.On(B3UnitedInfosConsts.GlobalFlags.库存支持品牌项); + WpfPageFactory.RegisterPageOverlay(typeof(OrderEdit).FullName, typeof(OrderEdit_Ext).FullName); } public void OnUnitInit() diff --git a/BWP.B3_YunKen/BWP.B3_YunKen.csproj b/BWP.B3_YunKen/BWP.B3_YunKen.csproj index fa78861..22f0874 100644 --- a/BWP.B3_YunKen/BWP.B3_YunKen.csproj +++ b/BWP.B3_YunKen/BWP.B3_YunKen.csproj @@ -54,7 +54,9 @@ + + diff --git a/BWP.B3_YunKen/Properties/AssemblyInfo.cs b/BWP.B3_YunKen/Properties/AssemblyInfo.cs index 7fc18c5..2dc8942 100644 --- a/BWP.B3_YunKen/Properties/AssemblyInfo.cs +++ b/BWP.B3_YunKen/Properties/AssemblyInfo.cs @@ -1,6 +1,7 @@ using System.Reflection; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.Ert; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -32,5 +33,6 @@ using Forks.EnterpriseServices.DomainObjects2; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyMapToTablePrefix("B3_YunKen_")] +[assembly: AssemblyMapToTablePrefix("B3_YunKen_")] +[assembly: ErtAbbr("B3_YunKen", "BWP.B3_YunKen")] diff --git a/BWP.B3_YunKen/Rpcs/DriverRpc.cs b/BWP.B3_YunKen/Rpcs/DriverRpc.cs new file mode 100644 index 0000000..a529a99 --- /dev/null +++ b/BWP.B3_YunKen/Rpcs/DriverRpc.cs @@ -0,0 +1,69 @@ +using BWP.B3Sale.BL; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.BusinessInterfaces; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.JsonRpc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BWP.B3_YunKen.Rpcs +{ + [Rpc] + public static class DriverRpc + { + [Rpc] + public static Driver GetDriverInfoByIDCard(string idCard) + { + var driver = new Driver(); + var query = new DQueryDom(new JoinAlias(typeof(Driver))); + query.Where.Conditions.Add(DQCondition.EQ("IDCard", idCard)); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("Name")); + query.Columns.Add(DQSelectColumn.Field("DriverCard")); + query.Columns.Add(DQSelectColumn.Field("Telephone")); + using (var session=Dmo.NewSession() ) + { + using (var reader=session.ExecuteReader(query)) + { + if (reader.Read()) + { + driver.ID = (long)reader[0]; + driver.Name = (string)reader[1]; + driver.DriverCard = (string)reader[2]; + driver.Telephone = (string)reader[3]; + } + } + } + return driver; + } + + [Rpc] + public static Car GetCarInfoByCarID(string carid) + { + var car = new Car(); + var query = new DQueryDom(new JoinAlias(typeof(Car))); + query.Where.Conditions.Add(DQCondition.EQ("ID", carid)); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("EngineNumber")); + query.Columns.Add(DQSelectColumn.Field("VinNO")); + query.Columns.Add(DQSelectColumn.Field("HandcarNumber")); + using (var session = Dmo.NewSession()) + { + using (var reader = session.ExecuteReader(query)) + { + if (reader.Read()) + { + car.ID = (long)reader[0]; + car.EngineNumber = (string)reader[1]; + car.VinNO = (string)reader[2]; + car.HandcarNumber = (string)reader[3]; + } + } + } + return car; + } + } +}