public IHttpActionResult PostTR_INV_FISICO(TR_INV_FISICO tR_INV_FISICO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TR_INV_FISICO.Add(tR_INV_FISICO); try { db.SaveChanges(); } catch (DbUpdateException) { if (TR_INV_FISICOExists(tR_INV_FISICO.c_LINEA)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tR_INV_FISICO.c_LINEA }, tR_INV_FISICO)); }
public IHttpActionResult PutTR_INV_FISICO(int id, TR_INV_FISICO tR_INV_FISICO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tR_INV_FISICO.c_LINEA) { return(BadRequest()); } db.Entry(tR_INV_FISICO).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TR_INV_FISICOExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTR_INV_FISICO(int id) { TR_INV_FISICO tR_INV_FISICO = db.TR_INV_FISICO.Find(id); if (tR_INV_FISICO == null) { return(NotFound()); } return(Ok(tR_INV_FISICO)); }
public IHttpActionResult DeleteTR_INV_FISICO(int id) { TR_INV_FISICO tR_INV_FISICO = db.TR_INV_FISICO.Find(id); if (tR_INV_FISICO == null) { return(NotFound()); } db.TR_INV_FISICO.Remove(tR_INV_FISICO); db.SaveChanges(); return(Ok(tR_INV_FISICO)); }