public ActionResult Edit(int paymentId) { var payment = _paymentRepository.GetPaymentById(paymentId); payment.PayRates = _payRateRepository.GetPayRatesList(); //companion.CompanionTypes = _companionManagmentRepository.GetCompanionTypes(); //companion.Banks = _patientManagmentRepository.GetBanks(); return(View(payment)); }
public PaymentModel GetPaymentObject(string patientCid) { PaymentModel payment = new PaymentModel(); var ben = _beneficiaryRepository.GetBeneficiary(patientCid); var patient = _patientRepository.GetPatient(patientCid); var companion = _companionRepository.GetCompanion(ben?.CompanionCID); if (patient != null && ben != null) { payment.IsActive = patient.IsActive; payment.PatientCID = patientCid; payment.PatientFName = patient.PatientFName; payment.PatientLName = patient.PatientLName; payment.PatientMName = patient.PatientMName; payment.Agency = patient.Agency; payment.Hospital = patient.Hospital; payment.CompanionCID = ben.CompanionCID; payment.CompanionFName = companion?.CompanionFName; payment.CompanionLName = companion?.CompanionLName; payment.CompanionMName = companion?.CompanionMName; payment.BeneficiaryMName = ben.BeneficiaryFName; payment.BeneficiaryBank = ben.BankName; payment.BeneficiaryIBan = ben.IBan; payment.BeneficiaryCID = ben.BeneficiaryCID; payment.BeneficiaryFName = ben.BeneficiaryFName; payment.BeneficiaryLName = ben.BeneficiaryLName; //Todo: This should be done a better way payment.Payments = GetPaymentsByPatientCid(patientCid)?.OrderByDescending(p => p.CreatedDate).ToList(); payment.PayRates = _payRateRepository.GetPayRatesList(); payment.PatientPayRate = _domainObjectRepository.Get <PayRate>(c => c.PayRateID == 1).PatientRate; payment.CompanionPayRate = !String.IsNullOrEmpty(ben.CompanionCID) ? _domainObjectRepository.Get <PayRate>(c => c.PayRateID == 1).CompanionRate : 0; } return(payment); }