コード例 #1
0
        public IActionResult Encerrar(int id)
        {
            var conta = new SinistroModel(HttpContextAccessor);

            conta.Finalizar(id);
            return(RedirectToAction("Sucesso"));
        }
コード例 #2
0
 public IActionResult Registrar(SinistroModel sinistro)
 {
     if (ModelState.IsValid)
     {
         sinistro.HttpContextAccessor = HttpContextAccessor;
         sinistro.Gravar();
         return(RedirectToAction("Sucesso", sinistro));
     }
     return(View());
 }
コード例 #3
0
        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());
        }
コード例 #4
0
        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());
        }