public IHttpActionResult PostPaymentReceiptMaster(PaymentReceiptMaster paymentReceiptMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PaymentReceiptMasters.Add(paymentReceiptMaster); try { db.SaveChanges(); } catch (DbUpdateException) { if (PaymentReceiptMasterExists(paymentReceiptMaster.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = paymentReceiptMaster.ID }, paymentReceiptMaster)); }
public IHttpActionResult PutPaymentReceiptMaster(long id, PaymentReceiptMaster paymentReceiptMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != paymentReceiptMaster.ID) { return(BadRequest()); } db.Entry(paymentReceiptMaster).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PaymentReceiptMasterExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetPaymentReceiptMaster(long id) { PaymentReceiptMaster paymentReceiptMaster = db.PaymentReceiptMasters.Find(id); if (paymentReceiptMaster == null) { return(NotFound()); } return(Ok(paymentReceiptMaster)); }
public IHttpActionResult DeletePaymentReceiptMaster(long id) { PaymentReceiptMaster paymentReceiptMaster = db.PaymentReceiptMasters.Find(id); if (paymentReceiptMaster == null) { return(NotFound()); } db.PaymentReceiptMasters.Remove(paymentReceiptMaster); db.SaveChanges(); return(Ok(paymentReceiptMaster)); }