コード例 #1
0
        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()
            }));
        }
コード例 #2
0
        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");
            }
        }
コード例 #3
0
 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"))));
     }
 }
コード例 #4
0
        public async Task <HdlBill> UpdateHdlBill(HdlBill bill)
        {
            var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_HDL_BILL_UPDATE);

            return(await requestProvider.PutAsync(url, bill));
        }
コード例 #5
0
        public async Task <HdlBill> InsertHdlBill(HdlBill bill)
        {
            var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_HDL_BILL_INSERT);

            return(await requestProvider.PostAsync(url, bill));
        }
コード例 #6
0
 public void InsertHdlBill(HdlBill bill)
 {
     hdlBillRepository.Insert(bill);
 }