public ActionResult List() { var data = _depotService.GetAll(); var model = Helpers.OrdersHelper.ConvertDepotsToListViewModel(data); return(View(model)); }
public ActionResult DrugUnitDepot() { var drugUnitWithDepot = _drugUnitDepotService.DrugUnitWithDepot(); var depots = (List <Depot>)_depotService.GetAll(); var model = Helpers.DrugUnitWithDepotHelperMethods.DrugUnitDepotToListItem(drugUnitWithDepot, depots); return(View(model)); }
public ActionResult MakeOrder() { IEnumerable <DepotViewModel> allDepots = depots.GetAll().Select(depot => new DepotViewModel() { Depot = depot, DepotDrugUnits = drugUnits.GetByDepot(depot.DepotId) }); return(View(allDepots)); }
// метод получающий drugUnit и его Depot public List <DrugUnitDepot> DrugUnitWithDepot() { List <DrugUnitDepot> result = new List <DrugUnitDepot>(); foreach (DrugUnit du in _drugUnitService.getAll()) { result.Add(new DrugUnitDepot(du, _depotService.GetAll().FirstOrDefault(x => x.DrugUnits != null && x.DrugUnits.Count != 0 && x.DrugUnits.Contains(du)))); } return(result); }
public ActionResult List(int page = 1) { DrugUnitsListViewModel model = new DrugUnitsListViewModel() { DrugUnits = drugUnits.GetPage(page, PageSize), PagingInfo = new PagingInfo() { CurrentPage = page, ItemsPerPage = PageSize, TotalItems = drugUnits.Count }, ExistingDepots = depots.GetAll() }; return(View(model)); }