string keyWord = Request["txtid"] ?? "";
string[] sArray = keyWord.Split(new char[] { ' ' });
#endregion
#region 过滤条件
var listReuqest = _systemlevelservice.QuerySystemLevel()
.WhereIf(m => m.IsActive == statues, Request["RequestStatus"].IsNotNullOrEmpty())
.Where(m => m.TenantID == CurrentUser.TenantId)
.WhereIf(m => m.CompanyGroupID == companyGroupID, !companyGroupID.IsNullOrEmpty())
.WhereIf(m => m.ControlKey == controlkey, !controlkey.IsNullOrEmpty())
//.WhereIf(m => m.LevelName.ToUpper().Contains(keyWord)
// || m.LevelEnName.ToUpper().Contains(keyWord)
// || m.Remark.ToUpper().Contains(keyWord)
// || m.Grade.ToString().Contains(keyWord),
// !string.IsNullOrEmpty(keyWord))
//keyWore是否出现在字段里
.WhereIf(m => sArray.Contains(m.LevelName.ToUpper())
|| sArray.Contains(m.LevelEnName.ToUpper())
|| sArray.Contains(m.Remark.ToUpper())
|| m.Remark.ToUpper().Contains(keyWord)
|| sArray.Contains(m.Grade.ToString()),
!string.IsNullOrEmpty(keyWord))
//字段是否出现在sArray里
//sArray是否出现在字段里
.PagerByEasyUI(Request, out total, CurrentUser.PageSize, "IsActive")
.AsEnumerable()
.Select(m => new
{
m.ID,
m.TenantID,
m.CompanyGroupID,
m.LevelName,
m.LevelEnName,
m.ControlKey,
m.Grade,
m.Remark,
m.IsActive
}).OrderByDescending(m => m.IsActive).ToList();
//sArray是否出现在字段里 怎么写
建议给代码加上高亮
– dudu 6年前