public IHttpActionResult PutFuncionario(decimal id, Funcionario funcionario) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != funcionario.iClaveFuncionario) { return(BadRequest()); } db.Entry(funcionario).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!FuncionarioExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutRoles(decimal id, Roles roles) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != roles.Rol_id) { return(BadRequest()); } db.Entry(roles).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!RolesExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutcatDiscriminante(decimal id, catDiscriminante catDiscriminante) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != catDiscriminante.catDiscriminante_id) { return(BadRequest()); } db.Entry(catDiscriminante).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!catDiscriminanteExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }