public IActionResult CreateManutencao()
        {
            var automovels = _todosAutomovelService.FindAll();
            var oficinas   = _oficinaService.FindAll();
            var viewModel  = new ManutencaoFormViewModel {
                Automovels = automovels, Oficinas = oficinas
            };

            return(View(viewModel));
        }
Пример #2
0
        public IActionResult EditManutencao(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var obj = _manutencaoService.FindById(id.Value);

            if (obj == null)
            {
                return(NotFound());
            }

            List <Automovel>        automovels = _todosAutomovelService.FindAll();
            List <Oficina>          oficinas   = _oficinaService.FindAll();
            ManutencaoFormViewModel viewModel  = new ManutencaoFormViewModel {
                Manutencao = obj, Automovels = automovels, Oficinas = oficinas
            };

            return(View(viewModel));
        }