// GET: Patient public ActionResult Index() { IBL bl = new BLImplement(); var lst = new List <PatientViewModel> (); foreach (var item in bl.getAllPatients()) { lst.Add(new PatientViewModel(item)); } return(View(lst)); }
public ForDoctorViewModel(Doctor d) { this.doctor = d; IBL bl = new BLImplement(); var p = bl.getAllPatients(); patients = new List <PatientViewModel>(); foreach (var item in p) { patients.Add(new PatientViewModel(item)); } }
// GET: Prescription public ActionResult Index(string id)//IEnumerable<Prescription> prescriptions) { IBL bl = new BLImplement(); var patient = bl.getPatient(id); if (patient == null) { patient = bl.getAllPatients().FirstOrDefault(X => X.Name == id);//when return to list } var prescriptions = bl.allPrescriptionFromPatient(patient); if (prescriptions == null) { ViewBag.Message = String.Format("There are no prescription for {0} yet", patient.Name); return(RedirectToAction("DoctorOptions")); } var lst = new List <PrescriptionViewModel>(); foreach (var item in prescriptions) { lst.Add(new PrescriptionViewModel(item)); } return(View(lst)); }