Ejemplo n.º 1
0
        public async Task <PatientBillPayment> DeletePatientBillPayment(PatientBillPayment patientBillPayment)
        {
            var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_PATIENT_BILL_PAYMENT_DELETE);

            return(await requestProvider.DeleteAsync(url, patientBillPayment, new Dictionary <string, string> {
                ["id"] = patientBillPayment.Id.ToString()
            }));
        }
        public void InsertBillPayment(PatientBillPayment billPayment)
        {
            billPaymentRepository.Insert(billPayment);

            var billFromDb = patientBillRepository.Get(billPayment.BillId);

            if (billFromDb != null)
            {
                billFromDb.AmountPaid = (double?)billPayment.PaymentAmount;
                billFromDb.Balance    = (double?)billPayment.Balance;
                patientBillRepository.Update(billFromDb);
            }
        }
 public ActionResult UpdatePatientBillPayment(PatientBillPayment patientBillPayment)
 {
     if (patientBillPayment != null)
     {
         try
         {
             financeService.UpdateBillPayment(patientBillPayment);
         }
         catch (Exception e)
         {
             Program.Logger.Error(e);
             return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the patient bill payment record"))));
         }
         return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS)));
     }
     else
     {
         return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper patient bill payment details"))));
     }
 }
        public void UpdateBillPayment(PatientBillPayment billPayment)
        {
            var patientBillPaymentFromDb = billPaymentRepository.Get(billPayment.Id);

            if (patientBillPaymentFromDb != null)
            {
                _util.CopyProperties(billPayment, patientBillPaymentFromDb);
                billPaymentRepository.Update(patientBillPaymentFromDb);

                var billFromDb = patientBillRepository.Get(billPayment.BillId);
                if (billFromDb != null)
                {
                    billFromDb.AmountPaid = (double?)billPayment.PaymentAmount;
                    billFromDb.Balance    = (double?)billPayment.Balance;
                    patientBillRepository.Update(billFromDb);
                }
            }
            else
            {
                throw new Exception("This patient bill payment record does not exist");
            }
        }
Ejemplo n.º 5
0
        public async Task <PatientBillPayment> UpdatePatientBillPayment(PatientBillPayment patientBillPayment)
        {
            var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_PATIENT_BILL_PAYMENT_UPDATE);

            return(await requestProvider.PutAsync(url, patientBillPayment));
        }
Ejemplo n.º 6
0
        public async Task <PatientBillPayment> InsertPatientBillPayment(PatientBillPayment patientBillPayment)
        {
            var url = URLBuilder.GetURL(Controllers.FINANCE, EndPoint.FINANCE_PATIENT_BILL_PAYMENT_INSERT);

            return(await requestProvider.PostAsync(url, patientBillPayment));
        }