public async Task <HdlBill> DeleteHdlBill(HdlBill bill) { var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_HDL_BILL_DELETE); return(await requestProvider.DeleteAsync(url, bill, new Dictionary <string, string> { ["id"] = bill.Id.ToString() })); }
public void UpdateHdlBill(HdlBill bill) { var hdlBillFromDb = hdlBillRepository.Get(bill.Id); if (hdlBillFromDb != null) { _util.CopyProperties(bill, hdlBillFromDb); hdlBillRepository.Update(hdlBillFromDb); } else { throw new Exception("This Doctor/Hospital bill does not exist"); } }
public ActionResult UpdateHdlBill(HdlBill hdlBill) { if (hdlBill != null) { try { financeService.UpdateHdlBill(hdlBill); } catch (Exception e) { Program.Logger.Error(e); return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the bill")))); } return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS))); } else { return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper bill details")))); } }
public async Task <HdlBill> UpdateHdlBill(HdlBill bill) { var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_HDL_BILL_UPDATE); return(await requestProvider.PutAsync(url, bill)); }
public async Task <HdlBill> InsertHdlBill(HdlBill bill) { var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_HDL_BILL_INSERT); return(await requestProvider.PostAsync(url, bill)); }
public void InsertHdlBill(HdlBill bill) { hdlBillRepository.Insert(bill); }