public IHttpActionResult PostMA_ESTRUCT_REPORT(MA_ESTRUCT_REPORT mA_ESTRUCT_REPORT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_ESTRUCT_REPORT.Add(mA_ESTRUCT_REPORT); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_ESTRUCT_REPORTExists(mA_ESTRUCT_REPORT.Clave)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_ESTRUCT_REPORT.Clave }, mA_ESTRUCT_REPORT)); }
public IHttpActionResult PutMA_ESTRUCT_REPORT(string id, MA_ESTRUCT_REPORT mA_ESTRUCT_REPORT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_ESTRUCT_REPORT.Clave) { return(BadRequest()); } db.Entry(mA_ESTRUCT_REPORT).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_ESTRUCT_REPORTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_ESTRUCT_REPORT(string id) { MA_ESTRUCT_REPORT mA_ESTRUCT_REPORT = db.MA_ESTRUCT_REPORT.Find(id); if (mA_ESTRUCT_REPORT == null) { return(NotFound()); } return(Ok(mA_ESTRUCT_REPORT)); }
public IHttpActionResult DeleteMA_ESTRUCT_REPORT(string id) { MA_ESTRUCT_REPORT mA_ESTRUCT_REPORT = db.MA_ESTRUCT_REPORT.Find(id); if (mA_ESTRUCT_REPORT == null) { return(NotFound()); } db.MA_ESTRUCT_REPORT.Remove(mA_ESTRUCT_REPORT); db.SaveChanges(); return(Ok(mA_ESTRUCT_REPORT)); }