public IHttpActionResult PostTR_ORDEN_PRODUCCION(TR_ORDEN_PRODUCCION tR_ORDEN_PRODUCCION) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TR_ORDEN_PRODUCCION.Add(tR_ORDEN_PRODUCCION); try { db.SaveChanges(); } catch (DbUpdateException) { if (TR_ORDEN_PRODUCCIONExists(tR_ORDEN_PRODUCCION.c_Documento)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tR_ORDEN_PRODUCCION.c_Documento }, tR_ORDEN_PRODUCCION)); }
public IHttpActionResult PutTR_ORDEN_PRODUCCION(string id, TR_ORDEN_PRODUCCION tR_ORDEN_PRODUCCION) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tR_ORDEN_PRODUCCION.c_Documento) { return(BadRequest()); } db.Entry(tR_ORDEN_PRODUCCION).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TR_ORDEN_PRODUCCIONExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTR_ORDEN_PRODUCCION(string id) { TR_ORDEN_PRODUCCION tR_ORDEN_PRODUCCION = db.TR_ORDEN_PRODUCCION.Find(id); if (tR_ORDEN_PRODUCCION == null) { return(NotFound()); } return(Ok(tR_ORDEN_PRODUCCION)); }
public IHttpActionResult DeleteTR_ORDEN_PRODUCCION(string id) { TR_ORDEN_PRODUCCION tR_ORDEN_PRODUCCION = db.TR_ORDEN_PRODUCCION.Find(id); if (tR_ORDEN_PRODUCCION == null) { return(NotFound()); } db.TR_ORDEN_PRODUCCION.Remove(tR_ORDEN_PRODUCCION); db.SaveChanges(); return(Ok(tR_ORDEN_PRODUCCION)); }