修改基础资料

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

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