public ActionResult WarehouseState() { var model = new WarehouseStateListModel() { Availablewarehouses = _shippingService.GetAllWarehouses() .Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList() }; model.Availablewarehouses.Insert(0, new SelectListItem { Text = _localizationService.GetResource(""), Value = "0" }); return(View(model)); }
public ActionResult WarehouseStateList(DataSourceRequest command, WarehouseStateListModel model) { var states = _managerWarehouseService.GetStatesByWarehouse(model.WarehouseId); var gridModel = new DataSourceResult { Data = states.Select(x => new WarehouseStateModel { Id = x.Id, WarehouseName = x.Warehouse.Name, Published = x.Published, WarehouseId = x.WarehouseId, NameState = x.NameState, ParentStateId = x.ParentStateId, ParentStateName = _managerWarehouseService.GetWarehouseStateById(x.Id).NameState, }), Total = states.Count }; return(Json(gridModel)); }