private object GetData(PagerQuery<PagerInfo, CriteriaRetroaction, IEnumerable<RetroactionListModel>> pagerQuery = null) { var pageInfo = new PagerInfo(this.HttpContext); if (pagerQuery == null) { pagerQuery = new PagerQuery<PagerInfo, CriteriaRetroaction, IEnumerable<RetroactionListModel>>(pageInfo, new CriteriaRetroaction(), null); } else { if (string.IsNullOrWhiteSpace(pagerQuery.Search.lease_holder) && this.CurrentUser.Userid != "0505") { pagerQuery.Search.lease_holder = this.CurrentUser.Userid; } int recordCount = 0; int TotalPages = 0; var resultMsg = string.Empty; var data = this.facade.QueryWebproCusreturnListPager(out resultMsg, out recordCount, out TotalPages, pagerQuery.Search, pageInfo.PageSize, pageInfo.CurrentPageIndex).ToList<RetroactionListModel>(); pageInfo.RecordCount = recordCount; pagerQuery.Pager = pageInfo; pagerQuery.Pager.TotalPages = TotalPages; pagerQuery.DataList = data; } pagerQuery.Search.CustomerNameList = DropDownListFor.GetCustomerNameSelect(this.CurrentUser.Userid, "", null, true); return pagerQuery; }
private object GetData(PagerQuery<PagerInfo, CriteriaImport, IEnumerable<ImportListModel>> pagerQuery = null) { var pageInfo = new PagerInfo(this.HttpContext); if (pagerQuery == null) { pagerQuery = new PagerQuery<PagerInfo, CriteriaImport, IEnumerable<ImportListModel>>(pageInfo, new CriteriaImport(), null); } else { int recordCount = 0; int TotalPages = 0; var resultMsg = string.Empty; } return pagerQuery; }
private object GetData(PagerQuery<PagerInfo, CriteriaNuclearButton, IEnumerable<NuclearButtonListModel>> pagerQuery = null) { var pageInfo = new PagerInfo(this.HttpContext); if (pagerQuery == null) { pagerQuery = new PagerQuery<PagerInfo, CriteriaNuclearButton, IEnumerable<NuclearButtonListModel>>(pageInfo, new CriteriaNuclearButton(), null); pagerQuery.Search.WayOutStartTime = DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd"); pagerQuery.Search.WayOutEndTime = DateTime.Now.ToString("yyyy-MM-dd"); } else { int recordCount = 0; int TotalPages = 0; var resultMsg = string.Empty; if (string.IsNullOrWhiteSpace(pagerQuery.Search.CustomerName)&&this.CurrentUser.Userid!="0505") { pagerQuery.Search.CustomerName = this.CurrentUser.Userid; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.WayOutStartTime)) { pagerQuery.Search.WayOutStartTime += " 00:00:00"; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.WayOutEndTime)) { pagerQuery.Search.WayOutEndTime += " 23:59:59"; } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.CargoType)) { pagerQuery.Search.CargoTypeTest = Universal.GetStatusName(_Dictionary.CargoType, pagerQuery.Search.CargoType); } if (!string.IsNullOrWhiteSpace(pagerQuery.Search.ApprovalStatus)) { decimal status = Convert.ToDecimal(pagerQuery.Search.ApprovalStatus); pagerQuery.Search.ApprovalStatus = ((int)status).ToString(); } var data = this.facadeVHk.QueryV_HKListPager(out resultMsg, out recordCount, out TotalPages, pagerQuery.Search, pageInfo.PageSize, pageInfo.CurrentPageIndex).ToList<NuclearButtonListModel>(); pageInfo.RecordCount = recordCount; pagerQuery.Pager = pageInfo; pagerQuery.Pager.TotalPages = TotalPages; pagerQuery.DataList = data; } pagerQuery.Search.CargoTypeList = DropDownListFor.GetCargoTypeSelect(null, true); pagerQuery.Search.CustomerNameList = DropDownListFor.GetCustomerNameSelect(this.CurrentUser.Userid, pagerQuery.Search.CargoType, null, true); pagerQuery.Search.WayOutList = DropDownListFor.GetWayOutSelect(null, true); pagerQuery.Search.LockStatusList = DropDownListFor.GetLockingStatusSelect(null, false); pagerQuery.Search.ApprovalStatusList = DropDownListFor.GetApprovalStatusSelect(null, true); return pagerQuery; }
private PagerQuery<PagerInfo, CriteriaDetaildata, IEnumerable<DetaildataListModel>> GetData(PagerQuery<PagerInfo, CriteriaDetaildata, IEnumerable<DetaildataListModel>> model = null) { if (model == null) { model = new PagerQuery<PagerInfo, CriteriaDetaildata, IEnumerable<DetaildataListModel>>(); } var recordCount = decimal.Zero; var resultMsg = string.Empty; var pager = new PagerInfo(this.HttpContext); IFacadeDetaildata dataFacade= new FacadeDetaildata(); IEnumerable<DetaildataListModel> listModel = new List<DetaildataListModel>(); DataSet data = dataFacade.QueryDetaildataListPager(out resultMsg, out recordCount, model.Search, pager.PageSize, pager.CurrentPageIndex); // todo : tolist pager.RecordCount = (int)recordCount; model.Pager = pager; model.DataList = listModel; return model; }
public ActionResult TestList(int? pageIndex, string sort, string sortDirection) { ViewBag.sort = sort; if (!pageIndex.HasValue) { pageIndex = 1; } if (string.IsNullOrEmpty(sort)) { sort = "UpdateTime"; } if (string.IsNullOrEmpty(sortDirection)) { sortDirection = "descending"; } ViewBag.sortDirection = (sortDirection == "ascending") ? "descending" : "ascending"; DataBase db = new DataBase(); List<RequestTestModels> TestRequestList = new List<RequestTestModels>(); TestRequestList = db.GetRequestTest(null, null, "", "", Session[SESSION_USERID].ToString()); PagerInfo pageInfo = new PagerInfo(); pageInfo.PageSize = PAGESIZE; pageInfo.PageIndex = pageIndex.Value; pageInfo.PageTotalCount = TestRequestList.Count; var query = from tr in TestRequestList orderby Utils.GetPropertyValue(tr, tr.TestModel, sort) descending select tr; if (sortDirection == "ascending") { query = from tr in TestRequestList orderby Utils.GetPropertyValue(tr, tr.TestModel, sort) ascending select tr; } //IEnumerable<RequestTestModels> data = TestRequestList.OrderByDescending(aa => aa.InsertDateTime).Skip(pageInfo.PageSize * (pageIndex.Value - 1)).Take(pageInfo.PageSize); IEnumerable<RequestTestModels> data = query.Skip(pageInfo.PageSize * (pageIndex.Value - 1)).Take(pageInfo.PageSize); PageQuery<PagerInfo, IEnumerable<RequestTestModels>> requestTestQuery = new PageQuery<PagerInfo, IEnumerable<RequestTestModels>>(pageInfo, data); return View(requestTestQuery); }