Beispiel #1
0
        public IActionResult Index(string filterString)
        {
            var doctorDtos       = _doctorManager.GetAllDoctors(filterString);
            var doctorViewModels = _vMMapper.Map(doctorDtos);

            return(View(doctorViewModels));
        }
        public IActionResult Index(int doctorId, string filterString)
        {
            DoctorId = doctorId;
            var doctorDtos = _doctorManager.GetAllDoctors(null)
                             .FirstOrDefault(x => x.Id == doctorId);

            var prescriptionDtos = _doctorManager.GetAllPrescriptionForADoctor(doctorId, filterString);

            var doctorViewModels = _vMMapper.Map(doctorDtos);

            doctorViewModels.Prescriptions = _vMMapper.Map(prescriptionDtos);


            return(View(doctorViewModels));
        }
        public IActionResult Index(int doctorId, int prescriptionId, string filterString)
        {
            DoctorId       = doctorId;
            PrescriptionId = prescriptionId;

            var prescriptionDtos = _doctorManager.GetAllPrescriptionForADoctor(doctorId, filterString)
                                   .FirstOrDefault(x => x.Id == prescriptionId);

            var medicineDtos = _doctorManager.GetAllMedicineForAPrescription(prescriptionId, null);

            var prescriptionViewModels = _vMMapper.Map(prescriptionDtos);

            prescriptionViewModels.Medicines = _vMMapper.Map(medicineDtos);


            return(View(prescriptionViewModels));
        }