public IHttpActionResult PosttblGastosSinComprobar(tblGastosSinComprobar tblgastossincomprobar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tblGastosSinComprobar.Add(tblgastossincomprobar); try { db.SaveChanges(); } catch (DbUpdateException) { if (tblGastosSinComprobarExists(tblgastossincomprobar.IdGastosSinComprobar)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tblgastossincomprobar.IdGastosSinComprobar }, tblgastossincomprobar)); }
// PUT api/GastosSinComprobar/5 public IHttpActionResult PuttblGastosSinComprobar(int id, tblGastosSinComprobar tblgastossincomprobar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tblgastossincomprobar.IdGastosSinComprobar) { return(BadRequest()); } db.Entry(tblgastossincomprobar).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tblGastosSinComprobarExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GettblGastosSinComprobar(int id) { tblGastosSinComprobar tblgastossincomprobar = db.tblGastosSinComprobar.Find(id); if (tblgastossincomprobar == null) { return(NotFound()); } return(Ok(tblgastossincomprobar)); }
public IHttpActionResult DeletetblGastosSinComprobar(int id) { tblGastosSinComprobar tblgastossincomprobar = db.tblGastosSinComprobar.Find(id); if (tblgastossincomprobar == null) { return(NotFound()); } db.tblGastosSinComprobar.Remove(tblgastossincomprobar); db.SaveChanges(); return(Ok(tblgastossincomprobar)); }