示例#1
0
        public ActionResult PrescribtionDetails(int patientId)
        {
            var prescriptions = _prescriptionService.GetPrescribtionByPatientId(patientId);

            prescriptions.Medicines = _medicineForPrescriptionService.All()
                                      .Where(x => x.PrescriptionId == prescriptions.Id).ToList();

            prescriptions.MedicalTests = _medicalTestService.All()
                                         .Where(x => x.PrescriptionId == prescriptions.Id).ToList();


            return(View(prescriptions));
        }
示例#2
0
        public ActionResult Invoice(int prescribtionId)
        {
            var prescribtion = _prescriptionService.All().Include(x => x.Patient).SingleOrDefault(x => x.Id == prescribtionId);

            if (prescribtion != null)
            {
                prescribtion.MedicalTests = _testService.All().Where(x => x.PrescriptionId == prescribtion.Id).ToList();
                prescribtion.Medicines    =
                    _medicineForPrescriptionService.All().Where(x => x.PrescriptionId == prescribtion.Id).ToList();
            }
            var invoice = new InvoiceViewModel
            {
                Prescribtion = prescribtion,
                Doctor       = _doctorProfileService.All().FirstOrDefault()
            };

            return(View(invoice));
        }