Esempio n. 1
0
        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());
            }
        }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
        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());
            }
        }