添加查询条件
This commit is contained in:
@@ -10,13 +10,17 @@ namespace NX.ERP.U8.Base
|
||||
{
|
||||
public class BinDAL
|
||||
{
|
||||
public IEnumerable<Bin> GetList()
|
||||
public IEnumerable<Bin> 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<Bin>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strwhere))
|
||||
{
|
||||
sql += $" where {strwhere}";
|
||||
}
|
||||
return conn.Query<Bin>(sql, Params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class CustomerDAL
|
||||
{
|
||||
public IEnumerable<Customer> GetList()
|
||||
public IEnumerable<Customer> 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<Customer>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Customer>(sql, Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class MaterielDAL
|
||||
{
|
||||
public IEnumerable<Materiel> GetList()
|
||||
public IEnumerable<Materiel> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
|
||||
|
||||
@@ -264,7 +264,11 @@ namespace NX.ERP.U8
|
||||
bSpecialOrder AS 客户订单专用,
|
||||
bTrackSaleBill AS 销售跟单
|
||||
from Inventory";
|
||||
return conn.Query<Materiel>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Materiel>(sql, Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,16 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class MaterielTypeDAL
|
||||
{
|
||||
public IEnumerable<MaterielType> GetList()
|
||||
public IEnumerable<MaterielType> 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<MaterielType>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<MaterielType>(sql, Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class SupplierDAL
|
||||
{
|
||||
public IEnumerable<Supplier> GetList()
|
||||
public IEnumerable<Supplier> 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<Supplier>(sql, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,13 +10,17 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class UnitDAL
|
||||
{
|
||||
public IEnumerable<Unit> GetList()
|
||||
public IEnumerable<Unit> 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<Unit>(sql, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,18 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class WarehouseDAL
|
||||
{
|
||||
public IEnumerable<Warehouse> GetList()
|
||||
public IEnumerable<Warehouse> 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<Warehouse>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Warehouse>(sql, Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user