public IActionResult Encerrar(int id) { var conta = new SinistroModel(HttpContextAccessor); conta.Finalizar(id); return(RedirectToAction("Sucesso")); }
public IActionResult Registrar(SinistroModel sinistro) { if (ModelState.IsValid) { sinistro.HttpContextAccessor = HttpContextAccessor; sinistro.Gravar(); return(RedirectToAction("Sucesso", sinistro)); } return(View()); }
public IActionResult AtendimentosSinistro(SinistroModel entity) { if (entity.UsuarioAtual != 0) { entity.HttpContextAccessor = HttpContextAccessor; ViewBag.ListaSinistro = entity.ListaSinistro(); } else { ViewBag.ListaSinistro = new List <SinistroModel>(); } var usuario = new UsuarioModel(HttpContextAccessor); ViewBag.ListaUsuario = usuario.ListaUsuario(); return(View()); }
public IActionResult Registrar(int?id) { var Sinistro = new SinistroModel(HttpContextAccessor); if (id != null) { var entity = Sinistro.CarregarRegistro(id); if (entity.Id > 0) { ViewBag.Registro = entity; } } ViewBag.ListaStatus = new List <string>(new string[] { StatusSinistro.Aberto.GetDescription(), StatusSinistro.Analise.GetDescription(), StatusSinistro.Finalizar.GetDescription() }); var usuario = new UsuarioModel(HttpContextAccessor); ViewBag.ListaUsuario = usuario.ListaUsuario(); return(View()); }