public ActionResult UpdateDoctor(int id) { ViewBag.doctorId = id; //Get the department list from dapartment table and pass it to view using viewbag ViewBag.DepartmentList = objDept.getDepartmentList(); //Get the doctor from database based on the selected doctor id var objDoctor = objDoc.getDoctorByID(id); if (objDoctor == null) { return(View("NotFound")); } else { UpdateDoctorModel objUpDoc = new UpdateDoctorModel(); objUpDoc.department_name = objDoctor.department_name; objUpDoc.first_name = objDoctor.first_name; objUpDoc.last_name = objDoctor.last_name; objUpDoc.email = objDoctor.email; objUpDoc.phone = objDoctor.phone; objUpDoc.specialty = objDoctor.specialty; objUpDoc.bio = objDoctor.bio; objUpDoc.photo_path = objDoctor.photo_path; return(View(objUpDoc)); } }
public ActionResult DoctorDetail(int id) { return(View(objDoc.getDoctorByID(id))); }