private void PrepareReturnRequestListModel(ReturnRequestListModel model) { string allString = _localizationService.GetResource("Admin.Common.All"); model.GridPageSize = _adminAreaSettings.GridPageSize; model.AvailableStores.Add(new SelectListItem() { Text = allString, Value = "0" }); model.AvailableStores.AddRange(_storeService.GetAllStores().ToSelectListItems()); model.AvailableReturnRequestStatus = ReturnRequestStatus.Pending.ToSelectList(false).ToList(); model.AvailableReturnRequestStatus.Insert(0, new SelectListItem() { Text = allString }); }
public ActionResult List(GridCommand command, ReturnRequestListModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageReturnRequests)) return AccessDeniedView(); var data = new List<ReturnRequestModel>(); var returnRequests = _orderService.SearchReturnRequests(model.SearchStoreId, 0, 0, model.SearchReturnRequestStatus, command.Page - 1, command.PageSize, model.SearchId ?? 0); foreach (var rr in returnRequests) { var m = new ReturnRequestModel(); if (PrepareReturnRequestModel(m, rr, false)) data.Add(m); } var gridModel = new GridModel<ReturnRequestModel> { Data = data, Total = returnRequests.TotalCount, }; return new JsonResult { Data = gridModel }; }
public ActionResult List() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageReturnRequests)) return AccessDeniedView(); var model = new ReturnRequestListModel(); PrepareReturnRequestListModel(model); return View(model); }