Example #1
0
        public async Task <IActionResult> Editar(EmprestimoViewModel emprestimoViewModel)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(await GetForm(emprestimoViewModel)));
                }

                await _emprestimoService.Edit(emprestimoViewModel);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception)
            {
                TratarErro();
            }

            return(View());
        }