public IActionResult Index(int doctorId, string filterString) { TempData["DoctorId"] = doctorId; var doctorDto = _DoctorManager.GetAllDoctors(null).FirstOrDefault(x => x.Id == doctorId); var prescriptionDtos = _DoctorManager.GetAllPrescriptionForADoctor(doctorId, filterString); var doctorViewModel = _ViewModelMapper.Map(doctorDto); doctorViewModel.Prescriptions = _ViewModelMapper.Map(prescriptionDtos).ToList(); return(View(doctorViewModel)); }
public IActionResult Index(int doctorId, int prescriptionId, string filterString) { TempData["PrescriptionId"] = prescriptionId; TempData["DoctorId"] = doctorId; var prescriptionDto = _DoctorManager.GetAllPrescriptionForADoctor(doctorId, null).FirstOrDefault(x => x.Id == prescriptionId); var medicineDtos = _DoctorManager.GetAllMedicineForAPrescription(prescriptionId, filterString); var prescriptionViewModel = _ViewModelMapper.Map(prescriptionDto); prescriptionViewModel.Medicines = _ViewModelMapper.Map(medicineDtos).ToList(); return(View(prescriptionViewModel)); }
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)); }