public async Task <IActionResult> Edit(int id, [Bind("Id,Status,Setor,DataAbertura,ResponsavelId,Data,Hora,Solicitante,Descricao")] Chamados chamados)
        {
            if (id != chamados.Id)
            {
                return(NotFound());
            }



            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chamados);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChamadosExists(chamados.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }


            return(View(chamados));
        }
        public async Task <IActionResult> Create([Bind("Id,Status,Setor,Responsavel,DataAbertura,Data,Hora,Solicitante,Descricao")] Chamados chamados)
        {
            chamados.Data = DateTime.Today;
            chamados.Hora = DateTime.Now;


            if (ModelState.IsValid)
            {
                _context.Add(chamados);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }


            return(View(chamados));
        }