public async Task <IList <CorporateIncomeTotal> > CorporateIncomeTotalList(CorporateIncomeTotalIn CorporateIncomeTotalInfo) { //初步过滤 var query = _repository.GetAll().Where(CorporateIncomeTotalInfo.Expression).OrderByDescending(a => a.CreatedOn); return(await query.ToListAsync()); }
public async Task <ObjectResultModule> CorporateIncomeTotalPage([FromBody] CorporateIncomeTotalIn CorporateIncomeTotalInfo) { if (!Commons.CheckSecret(CorporateIncomeTotalInfo.Secret)) { this.ObjectResultModule.StatusCode = 422; this.ObjectResultModule.Message = "Wrong Secret"; this.ObjectResultModule.Object = ""; return(this.ObjectResultModule); } var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0; DateTime StartTime = new DateTime(); DateTime EndTime = new DateTime(); if (!string.IsNullOrEmpty(CorporateIncomeTotalInfo.StartTime)) { StartTime = DateTime.Parse(CorporateIncomeTotalInfo.StartTime); if (string.IsNullOrEmpty(CorporateIncomeTotalInfo.EndTime)) { CorporateIncomeTotalInfo.EndTime = DateTime.Now.ToString("yyyy-MM-dd"); } } if (!string.IsNullOrEmpty(CorporateIncomeTotalInfo.EndTime)) { EndTime = DateTime.Parse(CorporateIncomeTotalInfo.EndTime); } if (!string.IsNullOrEmpty(CorporateIncomeTotalInfo.StartTime)) { CorporateIncomeTotalInfo.AndAlso(t => t.CreatedOn >= StartTime); CorporateIncomeTotalInfo.AndAlso(t => t.CreatedOn < EndTime.AddDays(+1)); } CorporateIncomeTotalInfo.AndAlso(t => t.IsDelete == false); var values = await _corporateIncomeTotalService.CorporateIncomeTotalPage(CorporateIncomeTotalInfo); if (values.Items.Count() == 0) { this.ObjectResultModule.StatusCode = 204; this.ObjectResultModule.Message = "NoContent"; this.ObjectResultModule.Object = ""; } else { this.ObjectResultModule.Object = new CorporateIncomeTotalOut(values, CorporateIncomeTotalInfo); this.ObjectResultModule.StatusCode = 200; this.ObjectResultModule.Message = "success"; } #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "CorporateIncomeTotalPage", OperContent = JsonHelper.ToJson(CorporateIncomeTotalInfo), OperType = "CorporateIncomeTotalPage", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
public async Task <ObjectResultModule> CorporateIncomeTotalById([FromBody] CorporateIncomeTotalIn CorporateIncomeTotalInfo) { if (!Commons.CheckSecret(CorporateIncomeTotalInfo.Secret)) { this.ObjectResultModule.StatusCode = 422; this.ObjectResultModule.Message = "Wrong Secret"; this.ObjectResultModule.Object = ""; return(this.ObjectResultModule); } var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0; var values = await _corporateIncomeTotalService.CorporateIncomeTotalByID(CorporateIncomeTotalInfo.Id); if (values == null) { this.ObjectResultModule.Object = ""; this.ObjectResultModule.StatusCode = 404; this.ObjectResultModule.Message = "NotFound"; } else { this.ObjectResultModule.Object = values; this.ObjectResultModule.StatusCode = 200; this.ObjectResultModule.Message = "success"; } #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "CorporateIncomeTotalById", OperContent = JsonHelper.ToJson(CorporateIncomeTotalInfo), OperType = "CorporateIncomeTotalById", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(ObjectResultModule); }
public async Task <PagedResultDto <CorporateIncomeTotal> > CorporateIncomeTotalPage(CorporateIncomeTotalIn CorporateIncomeTotalInfo) { //初步过滤 var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(CorporateIncomeTotalInfo.Expression); //获取总数 var tasksCount = query.Count(); //获取总数 var totalpage = tasksCount / CorporateIncomeTotalInfo.MaxResultCount; var CorporateIncomeTotalList = await query.PageBy(CorporateIncomeTotalInfo.SkipTotal, CorporateIncomeTotalInfo.MaxResultCount).ToListAsync(); return(new PagedResultDto <CorporateIncomeTotal>(tasksCount, CorporateIncomeTotalList.MapTo <List <CorporateIncomeTotal> >())); }