public Tickets pegarTicket(int ticketID) { try { Tickets lista = new Tickets(); using (SestiEntities db = new SestiEntities()) { lista = (from t in db.Tickets where t.id == ticketID select t).FirstOrDefault(); } return(lista); } catch (Exception) { throw; } }
public void criarTicket(int usuario, string descricao, string titulo, string anexo) { try { AtualizacaoDominio atualizacao = new AtualizacaoDominio(); using (SestiEntities db = new SestiEntities()) { Tickets tick = new Tickets { Usuario = usuario, Data = DateTime.Now, }; db.Tickets.Add(tick); db.SaveChanges(); atualizacao.novaAtualizacao((int)tick.id, titulo, descricao, (int)tick.Usuario, 1, anexo); } } catch (Exception) { throw; } }