Пример #1
0
        public IActionResult List(DataSourceRequest command, ReturnReqestListModel model)
        {
            var returnRequestModels = _returnRequestViewModelService.PrepareReturnRequestModel(model, command.Page, command.PageSize);
            var gridModel           = new DataSourceResult
            {
                Data  = returnRequestModels.returnRequestModels,
                Total = returnRequestModels.totalCount,
            };

            return(Json(gridModel));
        }
        public async Task <IActionResult> List(DataSourceRequest command, ReturnReqestListModel model)
        {
            if (_workContext.CurrentCustomer.IsStaff())
            {
                model.StoreId = _workContext.CurrentCustomer.StaffStoreId;
            }
            var returnRequestModels = await _returnRequestViewModelService.PrepareReturnRequestModel(model, command.Page, command.PageSize);

            var gridModel = new DataSourceResult {
                Data  = returnRequestModels.returnRequestModels,
                Total = returnRequestModels.totalCount,
            };

            return(Json(gridModel));
        }