public ActionResult Index(string key = "", string fromdate = "", string todate = "", int page = 1, string chkExport = "0") { var totalItem = 0; var pageSize = 20; if (string.IsNullOrEmpty(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrEmpty(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } var list = _tblCardEventDeleteService.GetAllSql(key, fromdate, todate, page, pageSize, ref totalItem); var gridModel = PageModelCustom <tblCardEventDeleteCustom> .GetPage(list, page, pageSize, totalItem); ViewBag.keyValue = key; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = string.IsNullOrWhiteSpace(todate) ? DateTime.Now.ToString("dd/MM/yyyy 23:59") : todate; return(View(gridModel)); }
public ActionResult Index(string key, int page = 1, string chkExport = "0") { var pageSize = 20; var Dictionary = FunctionHelper.GetLocalizeDictionary("tblSubCard", "Index"); #region Excel //Excel if (chkExport.Equals("1")) { //Query lấy dữ liệu var listExcel = _tblSubCardService.Excel(key); //Xuất file theo format FormatCell(listExcel, Dictionary["TitleExcel"], "Sheet1", "", Dictionary["Title"]); return(RedirectToAction("ReportIn")); } #endregion var list = _tblSubCardService.GetAllPagingByFirst(key, page, pageSize); var gridModel = PageModelCustom <tblSubCard> .GetPage(list, page, pageSize); ViewBag.KeyWord = key; url = Request.Url.AbsoluteUri; ViewBag.objId = objId; return(View(gridModel)); }
public ActionResult Index(string key = "", string line = "", string GroupControllerId = "", int page = 1) { //var totalPage = 0; //var totalItem = 0; var pageSize = 20; var list = _tblAccessControllerService.GetAllPagingByFirst_AccessController(key, line, GroupControllerId, page, pageSize); foreach (var item in list) { if (!String.IsNullOrEmpty(item.ControllerGroupId)) { var ControllerGroupName = GetControllerGroupList().Where(n => n.Id == item.ControllerGroupId).FirstOrDefault().Name; item.ControllerGroupId = ControllerGroupName; } } var gridModel = PageModelCustom <tblAccessController> .GetPage(list, page, pageSize); ViewBag.KeyWord = key; ViewBag.Lines = GetLineList(); ViewBag.LineID = line; ViewBag.GroupController = GetControllerGroupList(); ViewBag.GroupControllerId = GroupControllerId; url = Request.Url.PathAndQuery; return(View(gridModel)); }
public ActionResult Index(string key, string fromdate, string todate, string actions, string users, int page = 1) { //Khai báo int pageSize = 20; //Lấy danh sách phân trang var list = _LogService.GetAllPagingByFirst(key, fromdate, todate, actions, users, page, pageSize); //Đổ lên grid var gridModel = PageModelCustom <Log> .GetPage(list, page, pageSize); //ViewBag ViewBag.keyValue = key; ViewBag.actionsValue = actions; ViewBag.usersValue = users; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = todate; url = Request.Url.PathAndQuery; ViewBag.actionList = FunctionHelper.LogActions().ToDataTableNullable(); ViewBag.userList = _UserService.GetAllActive().ToDataTableNullable(); return(View(gridModel)); }
public PagedListModel <Answer> GetByPaged(string Question_id, string key, int PageNumber, int PageSize) { var query = from n in _IAnswerRepository.Table join m in _IQuestionRepository.Table on n.Quesiton_id equals m._id select new Answer() { _id = n._id, AudioPath = n.AudioPath, Content = n.Content, CorrectIndex = n.CorrectIndex, CreatedDate = n.CreatedDate, ImagePath = n.ImagePath, IsActive = n.IsActive, Quesiton_id = n.Quesiton_id }; if (!string.IsNullOrWhiteSpace(Question_id)) { query = query.Where(x => x.Quesiton_id.Equals(Question_id)); } if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(x => x.CorrectIndex.Equals(key)); } var data = new PagedList <Answer>(query.OrderBy(x => x.Quesiton_id), PageNumber, PageSize); var pagedList = PageModelCustom <Answer> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public ActionResult Index(string key = "", string buildingIdSearch = "", string floorIdSearch = "", string apartmentIdSearch = "", string residentIdSearch = "", string typeSearch = "", string statusSearch = "", string userSearch = "", string userCreatedIdSearch = "", string fromDatePaid = "", string toDatePaid = "", string chkExport = "0", int page = 1, string selectedId = "") { int pageSize = 20; int total = 0; var list = _BM_Apartment_ReceiptService.GetAllPagingByFirstTSQL(key, buildingIdSearch, floorIdSearch, apartmentIdSearch, residentIdSearch, typeSearch, statusSearch, userSearch, userCreatedIdSearch, fromDatePaid, toDatePaid, page, pageSize, ref total); var gridModel = PageModelCustom <BM_Apartment_ReceiptView> .GetPage(list, page, pageSize, total); //search value ViewBag.keyValue = key; ViewBag.buildingIdSearch = buildingIdSearch; ViewBag.apartmentIdSearch = apartmentIdSearch; ViewBag.residentIdSearch = residentIdSearch; ViewBag.typeSearch = typeSearch; ViewBag.statusSearch = statusSearch; ViewBag.userSearch = userSearch; ViewBag.userCreatedIdSearch = userCreatedIdSearch; ViewBag.fromDatePaid = fromDatePaid; ViewBag.toDatePaid = toDatePaid; //list - selectlist ViewBag.selectedIdValue = selectedId; //gọi bên building Service ViewBag.BuildingSelectList = _BM_BuildingService.BuildingIdToDDL(); ViewBag.FloorSelectList = _BM_FloorService.FloorToDDL(buildingIdSearch); ViewBag.ApartmentSelectList = _BM_ApartmentService.ApartmentToDDL(buildingIdSearch, floorIdSearch); return(View(gridModel)); }
public PagedListModel <QuestionReport> GetByPaged(string Question_id, string Account_id, string Key, int PageNumber, int PageSize) { var query = from n in _IQuestionReportRepository.Table join m in _IQuesitonRepository.Table on n.Question_id equals m._id join k in _IAccountRepository.Table on n.Account_id equals k._id select new QuestionReport() { _id = n._id, Question_id = n.Question_id, Account_id = n.Account_id, Content = n.Content, CreatedDate = n.CreatedDate }; if (!string.IsNullOrWhiteSpace(Question_id) && !string.IsNullOrWhiteSpace(Account_id)) { query = query.Where(x => x.Question_id.Equals(Question_id) && x.Account_id.Equals(Account_id)); } if (!string.IsNullOrWhiteSpace(Key)) { query = query.Where(x => x.Content.Equals(Key)); } var data = new PagedList <QuestionReport>(query.OrderBy(x => x.Question_id), PageNumber, PageSize); var pagedList = PageModelCustom <QuestionReport> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public ActionResult Index(string key, string users, string actions, string fromdate, string todate, int page = 1, string group = "") { var name = FunctionHelper.getCurrentGroup(group); if (string.IsNullOrWhiteSpace(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrWhiteSpace(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } var pageSize = 20; //Lấy danh sách phân trang var list = _tblLogService.GetAllPagingByFirst(key, users, actions, fromdate, todate, page, pageSize, name); //Đổ lên grid var gridModel = PageModelCustom <tblLog> .GetPage(list, page, pageSize); ViewBag.keyValue = key; ViewBag.usersValue = users; ViewBag.actionsValue = actions; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = todate; ViewBag.GroupID = group; ViewBag.ActionValues = ActionList().ToDataTableNullable(); ViewBag.UserValues = UserList().ToDataTableNullable(); return(View(gridModel)); }
public PagedListModel <Event> GetByPaged(string Account_id, string Key, int PageNumber, int PageSize) { var query = from n in _IEventRepository.Table join m in _IAccountRepository.Table on n.Account_id equals m._id select new Event() { _id = n._id, Account_id = n.Account_id, Bonus = n.Bonus, ContentEvent = n.ContentEvent, Result = n.Result, TimeEnd = n.TimeEnd, TimeStart = n.TimeStart }; if (!string.IsNullOrWhiteSpace(Account_id)) { query = query.Where(x => x.Account_id.Equals(Account_id)); } if (!string.IsNullOrWhiteSpace(Key)) { query = query.Where(x => x.ContentEvent.Equals(Key)); } var data = new PagedList <Event>(query.OrderBy(x => x.TimeStart), PageNumber, PageSize); var pagedList = PageModelCustom <Event> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public PagedListModel <Topic> GetByPagedAccount(string Account_id, string Course_id, string key, int PageNumber, int PageSize) { var query = from n in _ITopicRepository.Table join m in _ICourseRepository.Table on n.Course_id equals m._id join acl in _AccountCourseLogRepository.Table on n._id equals acl.Course_id where acl.Account_id.Equals(Account_id) select new Topic() { _id = n._id, Course_id = m._id, BonusPoints = n.BonusPoints, ConquestPoints = n.ConquestPoints, CreatedDate = n.CreatedDate, Description = n.Description, ImagePath = n.ImagePath, Background = n.Background, IsActive = n.IsActive, NumberOfPraticeDays = n.NumberOfPraticeDays, PractisePoints = n.PractisePoints, TopicName = n.TopicName }; if (!string.IsNullOrWhiteSpace(Course_id)) { query = query.Where(n => n.Course_id.Equals(Course_id)); } if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(x => x.TopicName.Contains(key)); } var data = new PagedList <Topic>(query.OrderBy(n => n._id), PageNumber, PageSize); var pagedList = PageModelCustom <Topic> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public PagedListModel <Course> GetByPagedAccount(string accountId, string key, int PageNumber, int PageSize) { var query = from n in _CourseRepository.Table join acl in _AccountCourseLogRepository.Table on n._id equals acl.Course_id where acl.Account_id.Equals(accountId) select new Course() { Background = n.Background, PrerequisiteCourse = n.PrerequisiteCourse, CourseName = n.CourseName, CreatedDate = n.CreatedDate, Description = n.Description, ImagePath = n.ImagePath, Price = n.Price, IsActive = n.IsActive, CreatedBy = n.CreatedBy, ModifiedBy = n.ModifiedBy, ModifiedDate = n.ModifiedDate, _id = n._id }; if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(n => n.CourseName.Contains(key)); } var data = new PagedList <Course>(query.OrderBy(n => n._id), PageNumber, PageSize); var pagedList = PageModelCustom <Course> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public PagedListModel <Question> GetByPaged(string Topic_id, string key, int PageNumber, int PageSize) { var query = from n in _IQuestionRepository.Table join m in _ITopicRepository.Table on n.Topic_id equals m._id select new Question() { _id = n._id, Topic_id = n.Topic_id, AudioPath = n.AudioPath, Content = n.Content, CreatedDate = n.CreatedDate, ImagePath = n.ImagePath, IsActive = n.IsActive, Title = n.Title }; if (!string.IsNullOrWhiteSpace(Topic_id)) { query = query.Where(x => x.Topic_id.Equals(Topic_id)); } if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(x => x.Title.Contains(key)); } var data = new PagedList <Question>(query.OrderBy(x => x.Title), PageNumber, PageSize); var pagedList = PageModelCustom <Question> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public PagedListModel <RoomCustom> GetByPaged(string Home_id, string key, int PageNumber, int PageSize) { var query = from n in _RoomRepository.Table join m in _HomeRepository.Table on n.Home_id equals m._id select new RoomCustom() { _id = n._id, Home_id = n.Home_id, Home_name = m.Name, Name = n.Name, Acreage = n.Acreage, IsUsed = n.IsUsed }; if (!string.IsNullOrWhiteSpace(Home_id)) { query = query.Where(n => n.Home_id.Equals(Home_id)); } if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(n => n.Name.Contains(key)); } var data = new PagedList <RoomCustom>(query.OrderBy(n => n._id), PageNumber, PageSize); var pagedList = PageModelCustom <RoomCustom> .GetPage(data, PageNumber, PageSize); return(pagedList); }
/// <summary> /// Danh sách dịch vụ đã chọn /// </summary> /// <returns></returns> public PartialViewResult Partial_ChooseService(string strServiceChoose, string status, int page = 1) { var listobj = new List <BM_Building_ServiceCustom>(); int pagesize = 2; int totalitem = 0; ViewBag.Status = status; if (!string.IsNullOrEmpty(strServiceChoose)) { listobj = JsonConvert.DeserializeObject <List <BM_Building_ServiceCustom> >(strServiceChoose); //sắp xếp theo tên và thêm số thứ tự listobj = listobj.OrderBy(n => n.Name).Select((o, i) => { o.RowNumber = i + 1; return(o); }).ToList(); totalitem = listobj.Count; } //phân trang var newlist = listobj.Skip((page - 1) * pagesize).Take(pagesize).ToList(); if (newlist.Count == 0 && page > 1) { page = page - 1; newlist = listobj.Skip((page - 1) * pagesize).Take(pagesize).ToList(); } var gridModel = PageModelCustom <BM_Building_ServiceCustom> .GetPage(newlist, page, pagesize, totalitem); return(PartialView(gridModel)); }
public PagedListModel <PractiseTopic> GetByPaged(string Topic_id, string Account_id, string key, int PageNumber, int PageSize) { var query = from n in _IPratiseTopicRepository.Table join m in _ITopicRepository.Table on n.Topic_id equals m._id join k in _IAccountRepository.Table on n.Account_id equals k._id select new PractiseTopic() { _id = n._id, Account_id = n.Account_id, ComleteDate = n.ComleteDate, CreatedDate = n.CreatedDate, IsComplete = n.IsComplete, Note = n.Note, Topic_id = n.Topic_id }; if (!string.IsNullOrWhiteSpace(Topic_id) && !string.IsNullOrWhiteSpace(Account_id)) { query = query.Where(x => x.Account_id.Equals(Account_id) && x.Topic_id.Equals(Topic_id)); } if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(x => x.CreatedDate.Equals(key)); } var data = new PagedList <PractiseTopic>(query.OrderBy(x => x.CreatedDate), PageNumber, PageSize); var pagedList = PageModelCustom <PractiseTopic> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public ActionResult AQUAIndex(string customergroup = "", string key = "", string cardgroup = "", string fromdate = "", string todate = "", int page = 1) { // var totalPage = 0; var totalItem = 0; var pageSize = 20; double totalMoney = 0; var datefrompicker = ""; var customergroups = GetListChild("", customergroup); if (string.IsNullOrEmpty(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrEmpty(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } if (!string.IsNullOrWhiteSpace(fromdate) && !string.IsNullOrWhiteSpace(todate)) { datefrompicker = fromdate + "-" + todate; } #region Giao diện var systemconfig = _tblSystemConfigService.GetDefault(); var list = new List <OrderActiveCard>(); if (systemconfig.FeeName.Contains("AQUA")) { list = _OrderActiveCardService.GetListOrder_v2(key, fromdate, todate, cardgroup, customergroups, page, pageSize, ref totalItem, ref totalMoney).ToList(); } else { list = _OrderActiveCardService.GetListOrder(key, fromdate, todate, cardgroup, customergroups, page, pageSize, ref totalItem).ToList(); } var gridModel = PageModelCustom <OrderActiveCard> .GetPage(list, page, pageSize, totalItem); ViewBag.keyValue = key; ViewBag.cardgroupidsValue = cardgroup; ViewBag.customergroupidsValue = customergroup; ViewBag.cardgroups = GetListCardGroup().ToDataTableNullable(); ViewBag.customergroups = GetMenuList(); ViewBag.fromdateValue = fromdate; ViewBag.todateValue = !string.IsNullOrWhiteSpace(todate) ? Convert.ToDateTime(todate).ToString("dd/MM/yyyy HH:mm:59") : DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); ViewBag.TotalMoney = totalMoney; return(View(gridModel)); #endregion }
public ActionResult ReportLockerEvent(string key = "", string lockercontrol = "", string type = "", string cardgroup = "", string fromdate = "", string todate = "", string chkExport = "0", int page = 1) { // var totalPage = 0; var totalItem = 0; var pageSize = 20; var datefrompicker = ""; if (string.IsNullOrEmpty(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrEmpty(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } if (!string.IsNullOrWhiteSpace(fromdate) && !string.IsNullOrWhiteSpace(todate)) { datefrompicker = fromdate + "-" + todate; } #region Excel //Excel if (chkExport.Equals("1")) { //Query lấy dữ liệu var listExcel = _ReportService.GetReportLockerEvent_Excel(key, lockercontrol, type, cardgroup, fromdate, todate, ref totalItem); //Xuất file theo format ReportLockerEventFormatCell(listExcel, "", "Báo_cáo_sự_kiện_tủ_đồ", "Sheet1", "", "Báo cáo sự kiện tủ đồ", datefrompicker); return(RedirectToAction("ReportLockerEvent")); } #endregion #region Giao diện var list = _ReportService.GetReportLockerEvent(key, lockercontrol, type, cardgroup, fromdate, todate, page, pageSize, ref totalItem); var gridModel = PageModelCustom <tblLockerEvent_Report> .GetPage(list, page, pageSize, totalItem); ViewBag.CardGroupDT = GetCardGroupListNew().ToDataTableNullable(); ViewBag.CardGroupId = cardgroup; ViewBag.ControllerDT = GetControllerList().ToDataTableNullable(); ViewBag.ControllerId = lockercontrol; ViewBag.TypeDT = FunctionHelper.TypeEventLocker().ToDataTableNullable(); ViewBag.Type = type; ViewBag.KeyWord = key; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = !string.IsNullOrWhiteSpace(todate) ? Convert.ToDateTime(todate).ToString("dd/MM/yyyy HH:mm:59") : DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); #endregion return(View(gridModel)); }
public ActionResult Index(string key, string cardgroupids, string customergroupids, string userids, string fromdate, string todate, int page = 1, string chkExport = "0") { var Dictionary = FunctionHelper.GetLocalizeDictionary("ActiveCardList", "Index"); if (string.IsNullOrWhiteSpace(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrWhiteSpace(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } if (chkExport == "1") { var listExcel = _tblActiveCardService.ReportAllByFirst(key, "", fromdate, todate, cardgroupids, customergroupids, userids); //Xuất file theo format PK_ActiveCardListFormatCell(listExcel, Dictionary["TitleEx"], "Sheet1", "", Dictionary["Title"], fromdate + " - " + todate); return(RedirectToAction("Index")); } int pageSize = 20; var list = _tblActiveCardService.GetAllPagingByFirst(key, "", fromdate, todate, cardgroupids, customergroupids, userids, page, pageSize); if (list.Any()) { var strCustomer = new List <string>(); foreach (var item in list) { strCustomer.Add(item.CustomerID); } ViewBag.CustomerList = _tblCustomerService.GetAllByListId(strCustomer).ToList(); } var gridModel = PageModelCustom <tblActiveCardCustomViewModel> .GetPage(list, page, pageSize); // ViewBag.keyValue = key; ViewBag.cardgroupidsValue = cardgroupids; ViewBag.customergroupidsValue = customergroupids; ViewBag.usersValue = userids; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = todate; // ViewBag.cardgroups = GetListCardGroup().ToDataTableNullable(); ViewBag.users = GetListUser().ToDataTableNullable(); ViewBag.customergroups = GetMenuList(); return(View(gridModel)); }
public PartialViewResult boxCards(string key = "", string anotherkey = "", string cardgroups = "", string customergroup = "", string fromdate = "", string todate = "", int page = 1) { var pageSize = 20; var customergroups = GetListChild("", customergroup); var list = _tblCardService.GetAllCPagingByFirst(key, anotherkey, cardgroups, customergroups, fromdate, todate, page, pageSize); var gridModel = PageModelCustom <tblCardActive> .GetPage(list, page, pageSize); return(PartialView(gridModel)); }
public PartialViewResult boxCards(string key = "", string fromdate = "", string todate = "", string cargroup = "", string customerGr = "", int page = 1) { var str = ""; var customergr = GetCustomerGr(str, customerGr); int pageSize = 20; int total = 0; var list = _tblCardService.GetAllPagingByFirsts_Sql(key, fromdate, todate, customergr, cargroup, ref total, page, pageSize); var girdMode = PageModelCustom <tblCardExtend> .GetPage(list, pageSize, page, total); return(PartialView(girdMode)); }
public ActionResult Index(string key = "", int page = 1) { var pageSize = 20; var list = _tblAccessTimezoneService.GetAllPagingByFirst(key, page, pageSize); var gridModel = PageModelCustom <tblAccessTimezone> .GetPage(list, page, pageSize); ViewBag.KeyWord = key; url = Request.Url.PathAndQuery; return(View(gridModel)); }
public ActionResult ExtendList(string key, string cardgroupids, string customergroupids, string userids, string fromdate, string todate, int page = 1, string chkExport = "0", bool IsFilterByTime = true) { var Dictionary = FunctionHelper.GetLocalizeDictionary("ActiveCardList", "Index"); if (string.IsNullOrWhiteSpace(fromdate)) { fromdate = DateTime.Now.ToString("dd/MM/yyyy 00:00:00"); } if (string.IsNullOrWhiteSpace(todate)) { todate = DateTime.Now.ToString("dd/MM/yyyy 23:59:59"); } var totalItem = 0; var pageSize = 20; long totalMoney = 0; var strCG = new List <string>(); GetListChild(strCG, customergroupids); if (chkExport == "1") { var listExcel = _tblActiveCardService.GetDetailExtend_Excel(key, IsFilterByTime, fromdate, todate, cardgroupids, "", strCG, userids); //Xuất file theo format ExtendListFormatCell(listExcel, Dictionary["TitleDetailEx"], "Sheet1", "", Dictionary["TitleDetail"], fromdate + " - " + todate); return(RedirectToAction("Index")); } var list = _tblActiveCardService.GetDetailExtend(key, IsFilterByTime, fromdate, todate, cardgroupids, "", strCG, userids, page, pageSize, ref totalItem, ref totalMoney); var gridModel = PageModelCustom <ExtendList> .GetPage(list, page, pageSize, totalItem); // ViewBag.keyValue = key; ViewBag.cardgroupidsValue = cardgroupids; ViewBag.customergroupidsValue = customergroupids; ViewBag.usersValue = userids; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = todate; ViewBag.IsFilterByTime = IsFilterByTime; // ViewBag.cardgroups = GetListCardGroup().ToDataTableNullable(); ViewBag.users = GetListUser().ToDataTableNullable(); ViewBag.customergroups = GetMenuList(); return(View(gridModel)); }
public PagedListModel <Account> GetByPaged(string Key, int PageNumber, int PageSize) { var query = from n in _IAccountRepository.Table select n; if (!string.IsNullOrWhiteSpace(Key)) { query = query.Where(x => x.Username.Equals(Key)); } var data = new PagedList <Account>(query.OrderBy(x => x.Username), PageNumber, PageSize); var pagedList = PageModelCustom <Account> .GetPage(data, PageNumber, PageSize); return(pagedList); }
public ActionResult ReportLokerAlarm(string key = "", string objcontrol = "", string CardGroupID = "", string fromdate = "", string todate = "", string lockerAlarmCode = "", string lockerEventCode = "", string lockerEventType = "", string chkExport = "0", int page = 1) { // var totalPage = 0; var totalItem = 0; var pageSize = 20; var datefrompicker = ""; if (!string.IsNullOrWhiteSpace(fromdate) && !string.IsNullOrWhiteSpace(todate)) { datefrompicker = fromdate + "-" + todate; } #region Excel //Excel if (chkExport.Equals("1")) { //Query lấy dữ liệu var listExcel = _ReportService.GetReportLokerAlarm_Excel(key, objcontrol, lockerEventType, CardGroupID, lockerAlarmCode, lockerEventCode, fromdate, todate, page, pageSize, ref totalItem); //Xuất file theo format ReportLokerAlarm_FormatCell(listExcel, "", "Danh_sách_sự_kiện_cảnh_báo", "Sheet1", "", "Danh sách sự kiện cảnh báo", datefrompicker); return(RedirectToAction("ReportLokerAlarm")); } #endregion #region Giao diện var list = _ReportService.ReportLokerAlarm(key, objcontrol, lockerEventType, CardGroupID, lockerAlarmCode, lockerEventCode, fromdate, todate, page, pageSize, ref totalItem); var gridModel = PageModelCustom <tblLockerAlarmReport> .GetPage(list, page, pageSize, totalItem); ViewBag.KeyWord = key; ViewBag.fromdateValue = fromdate; ViewBag.todateValue = todate; ViewBag.controllerDT = GetControllerList().ToDataTableNullable(); ViewBag.controllerId = objcontrol; ViewBag.lockerEventCodeLst = FunctionHelper.LockerEventCode(); ViewBag.lockerEventCode = lockerEventCode; ViewBag.lockerEventTypeLst = FunctionHelper.LockerEventType(); ViewBag.lockerEventType = lockerEventType; ViewBag.lockerAlarmCodeLst = FunctionHelper.LockerAlarmCode(); ViewBag.lockerAlarmCode = lockerAlarmCode; ViewBag.CardGroupLst = GetCardGroupListNew().ToDataTableNullable(); ViewBag.CardGroupId = CardGroupID; #endregion return(View(gridModel)); }
public ActionResult Index(string key, int page = 1, string group = "", string selectedId = "") { var pageSize = 20; var list = _tblCompartmentService.GetPagingByFirst(key, page, pageSize); var gridModel = PageModelCustom <tblCompartment> .GetPage(list, page, pageSize); ViewBag.keyValue = key; ViewBag.groupValue = group; ViewBag.selectedIdValue = selectedId; return(View(gridModel)); }
public PagedListModel <Course> GetByPaged(string key, int PageNumber, int PageSize) { var query = from n in _CourseRepository.Table select n; if (!string.IsNullOrWhiteSpace(key)) { query = query.Where(n => n.CourseName.Contains(key)); } var data = new PagedList <Course>(query.OrderBy(n => n._id), PageNumber, PageSize); var pagedList = PageModelCustom <Course> .GetPage(data, PageNumber, PageSize); return(pagedList); }
//public PartialViewResult ListCardChoice(string key) //{ // //Load danh sách thẻ đã chọn // var selectedCard = GetSetFromSessionCard(null); // if (!string.IsNullOrWhiteSpace(key)) // { // selectedCard = selectedCard.Where(n => n.CardNo.Contains(key) || n.CardNumber.Contains(key) || n.Plate1.Contains(key) || n.Plate2.Contains(key) || n.Plate3.Contains(key)).ToList(); // } // return PartialView(selectedCard); //} /// <summary> /// Load danh sách khách hàng /// </summary> /// <param name="customergroupid">Id nhóm khách hàng</param> /// <param name="accesslevelids">Danh sách quyền chọn</param> /// <param name="page">Trang hiện tại</param> /// <returns></returns> public PartialViewResult ListCustomer(string key, string customergroupid, string accesslevelids, int page = 1, int pageSize = 10) { //Load danh sách thẻ đã chọn ViewBag.selectedCustomer = GetSetFromSessionCustomer(null); // var customergroups = GetListChild("", customergroupid); var list = _tblCustomerService.GetAllPagingByFirstForUpload(key, "", customergroups, "", "", page, pageSize, accesslevelids); var gridModel = PageModelCustom <tblCustomerExtend> .GetPage(list, page, pageSize); return(PartialView(gridModel)); }
public PartialViewResult AQUA_boxCards(string key = "", string newDateActive = "", string strIDCards = "", string address = "", string anotherkey = "", string cardgroups = "", string customergroup = "", string fromdate = "", string todate = "", int page = 1) { var pageSize = 20; double totalmoney = 0; int total = 0; var customergroups = GetListChild("", customergroup); var list = _tblCardService.AQUA_GetAllPagingByFirstSQL(key, address, strIDCards, anotherkey, cardgroups, customergroups, fromdate, todate, newDateActive, ref totalmoney, ref total, page, pageSize); var gridModel = PageModelCustom <tblCardExtend> .GetPage(list, page, pageSize, total); ViewBag.strIDCards = strIDCards; ViewBag.Total = totalmoney; return(PartialView(gridModel)); }
public PartialViewResult PartialLocker(string key, string controllerid, int page = 1, string taskid = "") { //Khai báo int pageSize = 20; //Lấy danh sách phân trang var list = _tblLockerService.GetAllPagingByFirst(key, controllerid, page, pageSize); //Đổ lên grid var listModel = PageModelCustom <tblLocker> .GetPage(list, page, pageSize); ViewBag.selectedLocker = GetSetDataLockerSession(taskid, "", "0"); return(PartialView(listModel)); }
public ActionResult Index(string key, int page = 1) { var pageSize = 20; var list = _tblCardGroupService.GetAllPagingByFirst(key, page, pageSize); var gridModel = PageModelCustom <tblCardGroup> .GetPage(list, page, pageSize); ViewBag.KeyWord = key; url = Request.Url.AbsoluteUri; ViewBag.objId = objId; return(View(gridModel)); }