public IHttpActionResult PutpaymentEFT(int id, paymentEFT paymentEFT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != paymentEFT.cardnumber) { return(BadRequest()); } db.Entry(paymentEFT).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!paymentEFTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetpaymentEFT(int id) { paymentEFT paymentEFT = db.paymentEFTs.Find(id); if (paymentEFT == null) { return(NotFound()); } return(Ok(paymentEFT)); }
public IHttpActionResult PostpaymentEFT(paymentEFT paymentEFT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.paymentEFTs.Add(paymentEFT); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = paymentEFT.cardnumber }, paymentEFT)); }
public IHttpActionResult DeletepaymentEFT(int id) { paymentEFT paymentEFT = db.paymentEFTs.Find(id); if (paymentEFT == null) { return(NotFound()); } db.paymentEFTs.Remove(paymentEFT); db.SaveChanges(); return(Ok(paymentEFT)); }