public IHttpActionResult ActualizarTicket(int id, [FromBody] ticket tick) { if (ModelState.IsValid) { var TicketExiste = dbContext.ticket.Count(c => c.ticket_id == id) > 0; if (TicketExiste) { dbContext.Entry(tick).State = EntityState.Modified; dbContext.SaveChanges(); return(Ok()); } else { return(NotFound()); } } else { return(BadRequest()); } }
public IHttpActionResult ActualizarUsuario(int id, [FromBody] usuario usu) { if (ModelState.IsValid) { var UsuarioExiste = dbContext.usuario.Count(c => c.usuario_id == id) > 0; if (UsuarioExiste) { dbContext.Entry(usu).State = EntityState.Modified; dbContext.SaveChanges(); return(Ok()); } else { return(NotFound()); } } else { return(BadRequest()); } }
public IHttpActionResult ActualizarSala(int id, [FromBody] sala sa) { if (ModelState.IsValid) { var SalaExiste = dbContext.sala.Count(c => c.sala_id == id) > 0; if (SalaExiste) { dbContext.Entry(sa).State = EntityState.Modified; dbContext.SaveChanges(); return(Ok()); } else { return(NotFound()); } } else { return(BadRequest()); } }