public ActionResult Edit(PatientMedicalHistoryViewModel model) { ModelState.Clear(); //ViewBag.Diseases = new SelectList(DiseasesManager.GetAllDiseases(), "DiseasesId", "Name"); //ViewBag.Patients = new SelectList(new List<Patient>(), "PatientId", "Name"); model.Patients = PatientManager.GetAllPatient(); model.Diseases = DiseasesManager.GetAllDiseases(); //model.Patients = PatientManager.GetPatientByDiseasesId(model.SearchField.SearchByDiseasesId); if (model.PatientHistoryId > 0) { var patientsMedicalHistory = PatientMedicalHistoryManager.GetHistorybyId(model.PatientHistoryId); model.PatientHistoryId = patientsMedicalHistory.PatientHistoryId; model.PatientId = patientsMedicalHistory.PatientId; model.DiseasesId = patientsMedicalHistory.DiseasesId; model.VitalSign = patientsMedicalHistory.VitalSign; model.Medicalhistory = patientsMedicalHistory.Medicalhistory; model.CreatedDate = patientsMedicalHistory.CreatedDate; model.ModifiedDate = patientsMedicalHistory.ModifiedDate; } return(View(model)); }