From e20107b10db4155549b3fa32be2102baeb7654b6 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 11 Jan 2021 09:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.U8/Base/BinDAL.cs | 8 ++++++-- NX.ERP.U8/Base/CustomerDAL.cs | 8 ++++++-- NX.ERP.U8/Base/MaterielDAL.cs | 8 ++++++-- NX.ERP.U8/Base/MaterielTypeDAL.cs | 8 ++++++-- NX.ERP.U8/Base/SupplierDAL.cs | 6 +++++- NX.ERP.U8/Base/UnitDAL.cs | 6 +++++- NX.ERP.U8/Base/WarehouseDAL.cs | 8 ++++++-- 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/NX.ERP.U8/Base/BinDAL.cs b/NX.ERP.U8/Base/BinDAL.cs index aa67bca..097000e 100644 --- a/NX.ERP.U8/Base/BinDAL.cs +++ b/NX.ERP.U8/Base/BinDAL.cs @@ -10,13 +10,17 @@ namespace NX.ERP.U8.Base { public class BinDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strwhere="",object Params=null) { using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) { var sql = @"select cPosCode as BinCode,cPosName as BinName,iPosGrade,bPosEnd,cWhCode as WarehouseCode, iMaxCubage as VolumeLimit, iMaxweight as WeightLimit,cMemo,cBarCode from Position"; - return conn.Query(sql, null); + if (!string.IsNullOrEmpty(strwhere)) + { + sql += $" where {strwhere}"; + } + return conn.Query(sql, Params); } } } diff --git a/NX.ERP.U8/Base/CustomerDAL.cs b/NX.ERP.U8/Base/CustomerDAL.cs index 93c26fc..b2340d2 100644 --- a/NX.ERP.U8/Base/CustomerDAL.cs +++ b/NX.ERP.U8/Base/CustomerDAL.cs @@ -9,7 +9,7 @@ namespace NX.ERP.U8 { public class CustomerDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere="",object Param=null) { @@ -21,7 +21,11 @@ namespace NX.ERP.U8 cCusPostCode AS PostalCode, cCusAddress AS Address, cCusPerson AS Contract,cCusPhone AS ContractPhone from Customer "; - return conn.Query(sql, null); + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } + return conn.Query(sql, Param); } } } diff --git a/NX.ERP.U8/Base/MaterielDAL.cs b/NX.ERP.U8/Base/MaterielDAL.cs index f0f312b..acd700f 100644 --- a/NX.ERP.U8/Base/MaterielDAL.cs +++ b/NX.ERP.U8/Base/MaterielDAL.cs @@ -9,7 +9,7 @@ namespace NX.ERP.U8 { public class MaterielDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere = "", object Param = null) { @@ -264,7 +264,11 @@ namespace NX.ERP.U8 bSpecialOrder AS 客户订单专用, bTrackSaleBill AS 销售跟单 from Inventory"; - return conn.Query(sql, null); + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } + return conn.Query(sql, Param); } } } diff --git a/NX.ERP.U8/Base/MaterielTypeDAL.cs b/NX.ERP.U8/Base/MaterielTypeDAL.cs index 5ebf468..19cec42 100644 --- a/NX.ERP.U8/Base/MaterielTypeDAL.cs +++ b/NX.ERP.U8/Base/MaterielTypeDAL.cs @@ -9,12 +9,16 @@ namespace NX.ERP.U8 { public class MaterielTypeDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere = "", object Param = null) { using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) { var sql = @"select cInvCCode AS MaterielTypeCode,cInvCName AS MaterielTypeName from InventoryClass "; - return conn.Query(sql, null); + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } + return conn.Query(sql, Param); } } } diff --git a/NX.ERP.U8/Base/SupplierDAL.cs b/NX.ERP.U8/Base/SupplierDAL.cs index f82e8d5..769306d 100644 --- a/NX.ERP.U8/Base/SupplierDAL.cs +++ b/NX.ERP.U8/Base/SupplierDAL.cs @@ -9,7 +9,7 @@ namespace NX.ERP.U8 { public class SupplierDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere = "", object Param = null) { @@ -21,6 +21,10 @@ namespace NX.ERP.U8 cVenPostCode AS PostalCode, cVenAddress AS Address, cVenPerson AS Contract from Vendor "; + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } return conn.Query(sql, null); } } diff --git a/NX.ERP.U8/Base/UnitDAL.cs b/NX.ERP.U8/Base/UnitDAL.cs index 9b4e64e..42cff6a 100644 --- a/NX.ERP.U8/Base/UnitDAL.cs +++ b/NX.ERP.U8/Base/UnitDAL.cs @@ -10,13 +10,17 @@ namespace NX.ERP.U8 { public class UnitDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere = "", object Param = null) { using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) { var sql = @"select cComunitCode AS UnitCode, cComUnitName AS UnitName,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit "; + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } return conn.Query(sql, null); } } diff --git a/NX.ERP.U8/Base/WarehouseDAL.cs b/NX.ERP.U8/Base/WarehouseDAL.cs index 10cae6e..190edfb 100644 --- a/NX.ERP.U8/Base/WarehouseDAL.cs +++ b/NX.ERP.U8/Base/WarehouseDAL.cs @@ -9,14 +9,18 @@ namespace NX.ERP.U8 { public class WarehouseDAL { - public IEnumerable GetList() + public IEnumerable GetList(string strWhere = "", object Param = null) { using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net)) { var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName from Warehouse"; - return conn.Query(sql, null); + if (!string.IsNullOrEmpty(strWhere)) + { + sql += $" where {strWhere}"; + } + return conn.Query(sql, Param); } } }