public IHttpActionResult PutIN_Requisition(int id, IN_Requisition iN_Requisition) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iN_Requisition.RequisID) { return(BadRequest()); } db.Entry(iN_Requisition).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IN_RequisitionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIN_Requisition(int id) { IN_Requisition iN_Requisition = db.IN_Requisition.Find(id); if (iN_Requisition == null) { return(NotFound()); } return(Ok(iN_Requisition)); }
public IHttpActionResult PostIN_Requisition(IN_Requisition iN_Requisition) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IN_Requisition.Add(iN_Requisition); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iN_Requisition.RequisID }, iN_Requisition)); }
public IHttpActionResult DeleteIN_Requisition(int id) { IN_Requisition iN_Requisition = db.IN_Requisition.Find(id); if (iN_Requisition == null) { return(NotFound()); } db.IN_Requisition.Remove(iN_Requisition); db.SaveChanges(); return(Ok(iN_Requisition)); }