public ActionResult AssociatePhysician(int physicianId, int patientId, bool isPrimary) { //Save selected physician for current patient (The patient whos detail is being shown) PatientPhysician pPhysician = new PatientPhysician(); pPhysician.PhysicianId = physicianId; pPhysician.PatientId = patientId; pPhysician.IsPrimary = isPrimary; _patientRepo.SavePatientPhysician(pPhysician); //Get list of saved patients for the current patient. and return this list to the patient detail page via ajax. ViewBag.PPhysicians = _patientRepo.GetPatientPhysicians(patientId); return(PartialView("_PartialPhysicians")); //return "response done"; }
public ActionResult ViewDetails(int id) { ViewBag.PatientDetail = _patientRepo.GetPatient(id); var pateitnPhysicians = _patientRepo.GetPatientPhysicians(id); int[] pIds = pateitnPhysicians.Select(p => p.PhysicianId).ToArray(); ViewBag.PhysiciansList = _phyRepo.GetPhysicians().Where(p => !pIds.Contains(p.Id)).ToList(); ViewBag.PPhysicians = pateitnPhysicians; return(View()); }