//GET : /Teacher/Update/{id} public ActionResult Update(int id) { TeacherDataController controller = new TeacherDataController(); Teacher SelectedTeacher = controller.FindTeacher(id); return(View(SelectedTeacher)); }
//POST : /Teacher/Delete/{id} public ActionResult Delete(int id) { TeacherDataController controller = new TeacherDataController(); controller.DeleteTeacher(id); return(RedirectToAction("List")); }
// GET: /Teachers/List public ActionResult List(string SearchKey = null) { TeacherDataController controller = new TeacherDataController(); IEnumerable <Teacher> Teachers = controller.ListTeacher(SearchKey); return(View(Teachers)); }
// GET: /Teachers/DeleteConfirm/{id} public ActionResult ConfirmDelete(int id) { TeacherDataController controller = new TeacherDataController(); Teacher NewTeacher = controller.FindTeacher(id); //IEnumerable<Course> NewCourse = controller.ListCourses(id); return(View(NewTeacher)); }
// GET: /Teachers/Show/{id} public ActionResult Show(int id) { TeacherDataController controller = new TeacherDataController(); Teacher SelectedTeacher = controller.FindTeacher(id); //IEnumerable<Course> NewCourse = controller.ListCourses(id); return(View(SelectedTeacher)); }
public ActionResult Create(string TeacherFname, string TeacherLname, string EmployeeNumber, decimal Salary) { Teacher NewTeacher = new Teacher(); NewTeacher.TeacherFname = TeacherFname; NewTeacher.TeacherLname = TeacherLname; NewTeacher.EmployeeNumber = EmployeeNumber; NewTeacher.Salary = Salary; TeacherDataController controller = new TeacherDataController(); controller.AddTeacher(NewTeacher); return(RedirectToAction("List")); }
public ActionResult Update(int id, string TeacherFname, string TeacherLname, string EmployeeNumber, DateTime HireDate, decimal Salary) { Teacher TeacherInfo = new Teacher(); TeacherInfo.TeacherFname = TeacherFname; TeacherInfo.TeacherLname = TeacherLname; TeacherInfo.EmployeeNumber = EmployeeNumber; TeacherInfo.HireDate = HireDate; TeacherInfo.Salary = Salary; TeacherDataController controller = new TeacherDataController(); controller.UpdateTeacher(id, TeacherInfo); return(RedirectToAction("Show/" + id)); }