修改基础资料

This commit is contained in:
admin
2021-01-20 16:31:45 +08:00
parent 7045313454
commit 0e95475880
14 changed files with 191 additions and 23 deletions

View File

@@ -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}%"
});
}
}
}