public PageableDTO <OrgResultDTO> Query(OrgSearchDTO q) { var token = q.UserInfo; q.InitQuery("ID", false); var status = q.Status.ToIntArray(); return(fcpa.fcpa_DistributorInfo.Where(p => (string.IsNullOrEmpty(q.DistributorName) ? true : p.DistributorName.Contains(q.DistributorName)) && (string.IsNullOrEmpty(q.Status) ? true : status.Any(a => p.Status == a)) ).Where(p => token.Role == 0 ? true : token.DistributorIDs.Contains(p.DistributorID)) .Select(p => new OrgResultDTO { ID = p.DistributorID, DistributorName = p.DistributorName, OrgMap = p.OrgMap, Trains = p.Trains, OrgMapUpdateTime = p.OrgMapUpdateTime, TrainsUpdateTime = p.TrainsUpdateTime, ValidNum = p.ValidNum, ShouldNum = p.ShouldNum, Rate = p.Rate }) .ToPageable(q)); }
public ActionResult Query(OrgSearchDTO dto) { UserLoginDTO lng = Session["UserLoginInfo"] as UserLoginDTO; dto.UserInfo = lng.UserInfo(); var result = OrgMapProvider.Query(dto); return(new JsonResult(result)); }
public ActionResult Export(OrgSearchDTO dto) { UserLoginDTO lng = Session["UserLoginInfo"] as UserLoginDTO; dto.UserInfo = lng.UserInfo(); dto.rows = int.MaxValue; dto.page = 1; var result = OrgMapProvider.Query(dto); var headers = new List <ExcelHeaderModel>() { new ExcelHeaderModel { Header = "公司", PropertyName = "DistributorName", Width = 40 }, new ExcelHeaderModel { Header = "状态", PropertyName = "Status", Width = 10 }, new ExcelHeaderModel { Header = "组织架构图更新日期", PropertyName = "OrgMapUpdateTime", Width = 22 }, new ExcelHeaderModel { Header = "培训人员名单更新日期", PropertyName = "TrainsUpdateTime", Width = 22 }, new ExcelHeaderModel { Header = "应参与培训的人员人数", PropertyName = "ValidNum", Width = 25 }, new ExcelHeaderModel { Header = "实际证书效期内的人员人数", PropertyName = "ShouldNum", Width = 25 }, new ExcelHeaderModel { Header = "完成率", PropertyName = "Rate", Width = 10 } }; var buffer = result.rows.ToExcel(headers); return(File(buffer, "application/vnd.ms-excel", string.Format("FCPA Training Record List({0}).xlsx", DateTime.Now.ToString("yyyyMMddHHmmss")))); }
public PageableDTO <OrgResultDTO> Query(OrgSearchDTO q) { return(_OrgMapService.Query(q)); }
public static PageableDTO <OrgResultDTO> Query(OrgSearchDTO dto) { return(PostAPI <PageableDTO <OrgResultDTO> >(WebConfiger.FcpaServicesUrl + "OrgMap/Query", dto)); }