Esempio n. 1
0
        public IActionResult Edit(int?id)
        {
            var model = id != null
                ? new EditMachineViewModel(_service.GetMachineItem(id.Value))
                : new EditMachineViewModel();

            model.Plants = _service.GetPlantItems().Select(a => new SelectListItem(a.PlantName, a.Id.ToString()));
            return(View(model));
        }
        public IActionResult Index()
        {
            var result = _service.GetPlantItems();
            var item   = new DisplayPlantViewModel
            {
                Items = result
            };

            return(View(item));
        }
Esempio n. 3
0
        public IActionResult Edit(int?id)
        {
            var model = id != null
                ? new EditBreakdownViewModel(_service.GetBreakdownItem(id.Value))
                : new EditBreakdownViewModel();

            model.BreakdownTypes       = _service.GetBreakdownTypeItems().Select(x => new SelectListItem(x.BreakdownTypeName, x.Id.ToString()));
            model.Machines             = _service.GetMachineItems().Select(x => new SelectListItem(x.MachineName, x.Id.ToString()));
            model.PersonnelsRequesting = _service.GetPersonnelItems()
                                         .Select(x => new SelectListItem(x.FirstName + " " + x.LastName, x.Id.ToString()));
            model.PersonnelsMaintenance = _service.GetPersonnelItems()
                                          .Select(x => new SelectListItem(x.FirstName + " " + x.LastName, x.Id.ToString()));
            model.Urgencies = _service.GetUrgencyItems()
                              .Select(x => new SelectListItem(x.UrgencyLevel, x.Id.ToString()));
            model.Plants = _service.GetPlantItems()
                           .Select(x => new SelectListItem(x.PlantName, x.Id.ToString()));

            return(View(model));
        }