Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }