public HttpResponseMessage Delete([FromBody] Models.purchase_order_master purchase_order_master) { try { bool deletePurchaseOrder = purchaseOrderRepository.DeletePurchaseOrder(purchase_order_master.purchase_order_master_id); if (deletePurchaseOrder == true) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "success", msg = "Purchase Order Delete Successfully." }, formatter)); } else { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "warning", msg = "Can not delete or cancel this Purchase Order because GRN already started." }, formatter)); } } catch (Exception ex) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "error", msg = ex.ToString() }, formatter)); } }
public HttpResponseMessage GetPurchaseOrderById([FromBody] Models.purchase_order_master purchase_order_master) { var purchaseOrderMaster = purchase_order_master.purchase_order_master_id; var poMaster = purchaseOrderRepository.GetPurchaseOrderById(purchaseOrderMaster); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, poMaster); return(response); }