public ActionResult New() { //THE INFORMATION REQUIRED TO PRESENT THIS PAGE IS AS FOLLOWS\\ //THE LIST OF HOSPITALS IN THE DATABASE //THE LIST OF DEPARTMENTS IN THE DATABASE var jobpostingedit = new JobPostingEdit(); jobpostingedit.Departments = db.Departments.ToList(); jobpostingedit.Hospitals = db.Hospitals.ToList(); return(View(jobpostingedit)); }
public ActionResult Edit(int id) { JobPostingEdit positioneditview = new JobPostingEdit(); //find all hospitals positioneditview.Hospitals = db.Hospitals.ToList(); //find all departments positioneditview.Departments = db.Departments.ToList(); positioneditview.JobPostings = db.JobPostings.Include(jp => jp.Hospital).Include(jp => jp.Department).SingleOrDefault(h => h.JobPostingID == id); //finds all job //GOTO: Views/Job/Edit.cshtml return(View(positioneditview)); }