예제 #1
0
        public PrescriptionPrintViewModel getPrescriptionDetailsForPrint(int prescriptiontID)
        {
            PrescriptionPrintViewModel prescriptionViewModel;

            using (Entities.Entities ctx = new Entities.Entities())
            {
                Prescription prescriptionEntity = ctx.Prescriptions.Find(prescriptiontID);
                if (prescriptionEntity != null)
                {
                    prescriptionViewModel = new PrescriptionPrintViewModel
                    {
                        PrescriptionID  = prescriptionEntity.PrescriptionID,
                        Notice          = prescriptionEntity.Notice,
                        DoctorName      = prescriptionEntity.Doctor.Name,
                        AppointmentDate = prescriptionEntity.Appointment.Start_date,
                        Medicines       = prescriptionEntity.Medicines.ToList(),
                        patientName     = prescriptionEntity.Patient.Name
                    };
                }
                else
                {
                    prescriptionViewModel = null;
                }
            }
            return(prescriptionViewModel);
        }
예제 #2
0
        //
        // GET: /DoctorDashboard/Prescription/PrescriptionDetails/5
        public ActionResult PrescriptionDetails(int prescriptionID = 0)
        {
            if (prescriptionID == 0)
            {
                return(HttpNotFound());
            }
            PrescriptionPrintViewModel prescription = prescriptionRepository.getPrescriptionDetailsForPrint(prescriptionID);

            if (prescription == null)
            {
                return(HttpNotFound());
            }
            prescription.AppointmentDate = DateTime.Now;
            return(View(prescription));
        }