修改基础资料
This commit is contained in:
@@ -9,24 +9,48 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class CustomerDAL
|
||||
{
|
||||
public IEnumerable<Customer> GetList(string strWhere="",object Param=null)
|
||||
public IEnumerable<Customer> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
|
||||
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var sql = @" select
|
||||
cCusCode AS Code,
|
||||
cCusName AS Name,
|
||||
cCusCode AS CustomerCode,
|
||||
cCusName AS CustomerName,
|
||||
cCusPostCode AS PostalCode,
|
||||
cCusAddress AS Address,
|
||||
cCusPerson AS Contract,cCusPhone AS ContractPhone from Customer ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
sql += $" where {strWhere} ";
|
||||
}
|
||||
return conn.Query<Customer>(sql, Param);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Customer> GetList(NX.ERP.Model.Request.Customer Params)
|
||||
{
|
||||
IList<string> where = new List<string>();
|
||||
if (string.IsNullOrEmpty(Params.CustomerCode))
|
||||
{
|
||||
where.Add(" cCusCode like @CustomerCode ");
|
||||
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Params.CustomerName))
|
||||
{
|
||||
where.Add(" cCusName like @CustomerName ");
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
CustomerCode = $"%{Params.CustomerCode}%",
|
||||
CustomerName = $"%{Params.CustomerName}%"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace NX.ERP.U8
|
||||
cVenName AS Name,
|
||||
cVenPostCode AS PostalCode,
|
||||
cVenAddress AS Address,
|
||||
cVenPhone as ContractPhone,
|
||||
cVenPerson AS Contract from Vendor ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
@@ -28,5 +29,31 @@ namespace NX.ERP.U8
|
||||
return conn.Query<Supplier>(sql, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Supplier> GetList(NX.ERP.Model.Request.Supplier Params)
|
||||
{
|
||||
IList<string> where = new List<string>();
|
||||
if (string.IsNullOrEmpty(Params.SupplierCode))
|
||||
{
|
||||
where.Add(" cVenCode like @SupplierCode ");
|
||||
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Params.SupplierName))
|
||||
{
|
||||
where.Add(" cVenName like @SupplierName ");
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
SupplierCode = $"%{Params.SupplierCode}%",
|
||||
SupplierName = $"%{Params.SupplierName}%"
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace NX.ERP.U8
|
||||
public class UnitDAL
|
||||
{
|
||||
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 Code,
|
||||
cComUnitName AS Name,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit ";
|
||||
cComunitCode AS UnitCode,
|
||||
cComUnitName AS UnitName,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
@@ -24,5 +24,29 @@ namespace NX.ERP.U8
|
||||
return conn.Query<Unit>(sql, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Unit> GetList(NX.ERP.Model.Request.Unit Params)
|
||||
{
|
||||
IList<string> where = new List<string>();
|
||||
if (string.IsNullOrEmpty(Params.UnitCode))
|
||||
{
|
||||
where.Add(" cComunitCode like @UnitCode ");
|
||||
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Params.UnitName))
|
||||
{
|
||||
where.Add(" cComUnitName like @UnitName ");
|
||||
}
|
||||
|
||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||
{
|
||||
UnitCode = $"%{Params.UnitCode}%",
|
||||
UnitName = $"%{Params.UnitName}%"
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user