public IActionResult CreateAbastecimento() { var automovels = _todosAutomovelService.FindAll(); var postos = _postoService.FindAll(); var viewModel = new AbastecimentoFormViewModel { Automovels = automovels, Postos = postos }; return(View(viewModel)); }
public IActionResult EditAbastecimento(int?id) { if (id == null) { return(NotFound()); } var obj = _abastecimentoService.FindById(id.Value); if (obj == null) { return(NotFound()); } List <Automovel> automovels = _todosAutomovelService.FindAll(); List <Posto> postos = _postoService.FindAll(); AbastecimentoFormViewModel viewModel = new AbastecimentoFormViewModel { Abastecimento = obj, Automovels = automovels, Postos = postos }; return(View(viewModel)); }