public IHttpActionResult PostMA_PARTES(MA_PARTES mA_PARTES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_PARTES.Add(mA_PARTES); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_PARTESExists(mA_PARTES.C_CODIGO)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_PARTES.C_CODIGO }, mA_PARTES)); }
public IHttpActionResult PutMA_PARTES(string id, MA_PARTES mA_PARTES) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_PARTES.C_CODIGO) { return(BadRequest()); } db.Entry(mA_PARTES).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_PARTESExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_PARTES(string id) { MA_PARTES mA_PARTES = db.MA_PARTES.Find(id); if (mA_PARTES == null) { return(NotFound()); } return(Ok(mA_PARTES)); }
public IHttpActionResult DeleteMA_PARTES(string id) { MA_PARTES mA_PARTES = db.MA_PARTES.Find(id); if (mA_PARTES == null) { return(NotFound()); } db.MA_PARTES.Remove(mA_PARTES); db.SaveChanges(); return(Ok(mA_PARTES)); }