/// <summary> /// 查询报表分页列表 /// </summary> /// <returns></returns> public ActionResult GetList() { string ReportNum = WebUtil.GetFormValue <string>("ReportNum"); string ReportName = WebUtil.GetFormValue <string>("ReportName"); int ReportType = WebUtil.GetFormValue <int>("ReportType", 0); int DsType = WebUtil.GetFormValue <int>("DsType", 0); int Status = WebUtil.GetFormValue <int>("Status", 0); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int PageSize = WebUtil.GetFormValue <int>("PageSize", 10); ReportsEntity entity = new ReportsEntity(); PageInfo pageInfo = new PageInfo() { PageIndex = PageIndex, PageSize = PageSize }; ReportProvider provider = new ReportProvider(CompanyID); if (ReportNum.IsNotEmpty()) { entity.And("ReportNum", ECondition.Like, "%" + ReportNum + "%"); } if (ReportName.IsNotEmpty()) { entity.And("ReportName", ECondition.Like, "%" + ReportName + "%"); } if (ReportType > 0) { entity.And(a => a.ReportType == ReportType); } if (DsType > 0) { entity.And(a => a.DsType == DsType); } if (Status > 0) { entity.And(a => a.Status == Status); } List <ReportsEntity> listResult = provider.GetList(entity, ref pageInfo); DataListResult <ReportsEntity> dataResult = new DataListResult <ReportsEntity>() { Code = (int)EResponseCode.Success, Message = "响应成功", Result = listResult, PageInfo = pageInfo }; return(Content(JsonHelper.SerializeObject(dataResult))); }
/// <summary> /// 批量删除 /// </summary> /// <param name="list"></param> /// <returns></returns> public int Delete(List <string> list) { if (!list.IsNullOrEmpty()) { ReportsEntity entity = new ReportsEntity(); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); entity.Where("SnNum", ECondition.In, list.ToArray()); entity.And(a => a.CompanyID == this.CompanyID); int line = this.Reports.Update(entity); return(line); } return(0); }