public object GetList(Pagination pagination, string title, string d1, string d2) { var imember = OperatorProvider.Provider.GetCurrent(); var exp = _repository.IQueryableAsNoTracking <Sys_Notice>(); if (imember.LoginType == LoginTypeEnum.AgentMember) { exp = exp.Where(p => p.AuditStatus == 1); } if (!string.IsNullOrEmpty(title)) { exp = exp.Where(p => p.Title.Contains(title)); } if (!string.IsNullOrEmpty(d1)) { DateTime _d1 = DateTime.Parse(d1); exp = exp.Where(p => p.JoinTime >= _d1); } if (!string.IsNullOrEmpty(d2)) { DateTime _d2 = DateTime.Parse(d2); exp = exp.Where(p => p.JoinTime <= _d2); } return(ExtLinq.QueryPaging(exp, pagination).ToList()); }
/// <summary> /// 获取列表 /// </summary> /// <param name="pagination"></param> /// <returns></returns> public object GetGridJson(Pagination pagination, string F_EnterpriseCode) { var op = OperatorProvider.Provider.GetCurrent(); var Query = _repository.IQueryableAsNoTracking <T_OILType>(); var enterpriseQuery = _repository.IQueryableAsNoTracking <T_Enterprise>(); if (!string.IsNullOrEmpty(F_EnterpriseCode)) { enterpriseQuery = enterpriseQuery.Where(p => p.F_Code == F_EnterpriseCode); } if (!op.IsSystem) { enterpriseQuery = enterpriseQuery.Where(p => p.F_Code == op.F_BelongTo); } var EnterpriseData = enterpriseQuery.ToList(); var enterpriseCodes = EnterpriseData.Select(p => p.F_Code).Distinct().ToList(); Query = Query.Where(p => enterpriseCodes.Contains(p.F_EnterpriseCode)); var query = ExtLinq.QueryPaging(Query, pagination).ToList(); var list = new List <OILTypeEntity>(); foreach (var item in query) { var enterprise = EnterpriseData.Where(p => p.F_Code == item.F_EnterpriseCode).FirstOrDefault(); list.Add(new OILTypeEntity() { F_ID = item.F_ID, F_Name = item.F_Name, F_EnterpriseCode = item.F_EnterpriseCode, F_EnterpriseName = enterprise?.F_Name, }); } return(list); }
public object GetSAPGridJson(Pagination pagination, string location) { var op = OperatorProvider.Provider.GetCurrent(); var Query = _repository.IQueryableAsNoTracking <T_SAPOIL>(); Query = Query.Where(p => p.F_Location == location); return(ExtLinq.QueryPaging(Query, pagination).ToList()); }
/// <summary> /// 超管之外的人查询公告 /// </summary> /// <param name="pagination"></param> /// <param name="title"></param> /// <param name="d1"></param> /// <param name="d2"></param> /// <returns></returns> public object GetListBySearch(Pagination pagination, string title, string d1, string d2) { var exp = _repository.IQueryableAsNoTracking <Sys_Notice>(p => p.IsUse && p.AuditStatus == 1); if (!string.IsNullOrEmpty(title)) { exp = exp.Where(p => p.Title.Contains(title)); } if (!string.IsNullOrEmpty(d1)) { DateTime _d1 = DateTime.Parse(d1); exp = exp.Where(p => p.JoinTime >= _d1); } if (!string.IsNullOrEmpty(d2)) { DateTime _d2 = DateTime.Parse(d2); exp = exp.Where(p => p.JoinTime <= _d2); } return(ExtLinq.QueryPaging(exp, pagination)); }
/// <summary> /// 获取列表 /// </summary> /// <param name="pagination"></param> /// <returns></returns> public object GetGridJson(Pagination pagination, string keyword) { var op = OperatorProvider.Provider.GetCurrent(); var Query = _repository.IQueryableAsNoTracking <T_WMS>(); if (!op.IsSystem) { Query = Query.Where(p => p.F_BelongTo == op.F_BelongTo); } if (!string.IsNullOrEmpty(keyword)) { Query = Query.Where(p => p.F_Code == keyword); } var query = ExtLinq.QueryPaging(Query, pagination).ToList(); var F_BelongTos = query.Select(p => p.F_BelongTo).Distinct().ToList(); var F_BillMethods = query.Select(p => p.F_BillMethod).Distinct().ToList(); var EnterS = _repository.IQueryableAsNoTracking <T_Enterprise>(p => F_BelongTos.Contains(p.F_Code)).ToList(); var BillMethodS = _repository.IQueryableAsNoTracking <T_BillMethod>(p => F_BillMethods.Contains(p.F_ID)).ToList(); var list = new List <YdkEntity>(); foreach (var item in query) { var enterprise = EnterS.Where(p => p.F_Code == item.F_BelongTo).FirstOrDefault(); var billMethod = BillMethodS.Where(p => p.F_ID == item.F_BillMethod).FirstOrDefault(); list.Add(new YdkEntity() { F_Code = item.F_Code, F_Name = item.F_Name, F_BelongTo = item.F_BelongTo, F_BillMethod = item.F_BillMethod, F_AllowError = item.F_AllowError, F_IPAddress = item.F_IPAddress, F_Position = item.F_Position, F_EnterpriseName = enterprise?.F_Name, F_BillName = billMethod?.F_Name }); } return(list); }
/// <summary> /// 获取列表 /// </summary> /// <param name="pagination"></param> /// <param name="d1"></param> /// <param name="d2"></param> /// <param name="type"></param> /// <returns></returns> public object GetGridJson(Pagination pagination, string d1, string d2, int type = 0) { var op = OperatorProvider.Provider.GetCurrent(); var userList = _repository.IQueryableAsNoTracking <Sys_User>().ToList(); var TypeList = _repository.IQueryableAsNoTracking <T_Type>().ToList(); var Query = _repository.IQueryableAsNoTracking <T_UploadContent>(p => p.F_TypeID == type); if (!string.IsNullOrEmpty(d1)) { DateTime dt1 = DateTime.Parse(d1); Query = Query.Where(p => p.F_DateTime >= dt1); } if (!string.IsNullOrEmpty(d2)) { DateTime dt2 = DateTime.Parse(d2); Query = Query.Where(p => p.F_DateTime < dt2); } var query = ExtLinq.QueryPaging(Query, pagination).ToList(); var list = new List <UploadContentEntity>(); foreach (var item in query) { var user = userList.Where(p => p.F_Account == item.F_Operator).FirstOrDefault(); list.Add(new UploadContentEntity() { F_ID = item.F_ID, F_Filename = item.F_Filename, F_Description = item.F_Description, F_Operator = item.F_Operator, F_DateTime = item.F_DateTime, F_TypeID = item.F_TypeID, F_Url = item.F_Url, F_UserName = user != null ? user.F_RealName : "", }); } return(list); }