public ActionResult CalculateDrugUnit() { var depots = _depotService.GetAllDepots().Select(f => new SelectListItem { Value = f.Id.ToString(), Text = f.Name }); var drugTypes = _drugTypeService.GetAllDrugTypes(); var viewModel = new DepotCalculateDrugUnitsViewModel { Depots = depots.ToList(), DrugTypes = drugTypes .Select(AutoMapper.Mapper.Map <DrugTypeCountViewModel>) .ToList() }; return(View(viewModel)); }
public ActionResult AssignToDepot() { var drugUnits = _drugUnitService.GetAllDrugUnits(); var depots = _depotService.GetAllDepots() .Select(f => new SelectListItem { Value = f.Id.ToString(), Text = f.Name }); var viewModel = new DrugUnitAssignViewModel { DrugUnits = drugUnits .Select(AutoMapper.Mapper.Map <DrugUnitViewModel>) .ToList(), Depots = depots.ToList() }; return(View(viewModel)); }