public IHttpActionResult PostMA_PAGOS(MA_PAGOS mA_PAGOS) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_PAGOS.Add(mA_PAGOS); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_PAGOSExists(mA_PAGOS.c_Caja)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_PAGOS.c_Caja }, mA_PAGOS)); }
public IHttpActionResult PutMA_PAGOS(string id, MA_PAGOS mA_PAGOS) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_PAGOS.c_Caja) { return(BadRequest()); } db.Entry(mA_PAGOS).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_PAGOSExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_PAGOS(string id) { MA_PAGOS mA_PAGOS = db.MA_PAGOS.Find(id); if (mA_PAGOS == null) { return(NotFound()); } return(Ok(mA_PAGOS)); }
public IHttpActionResult DeleteMA_PAGOS(string id) { MA_PAGOS mA_PAGOS = db.MA_PAGOS.Find(id); if (mA_PAGOS == null) { return(NotFound()); } db.MA_PAGOS.Remove(mA_PAGOS); db.SaveChanges(); return(Ok(mA_PAGOS)); }