public ActionResult Delete(int id) { TeacherDataController controller = new TeacherDataController(); controller.DeleteTeacher(id); return(RedirectToAction("List")); }
//GET : /Teacher/List public ActionResult List() { TeacherDataController controller = new TeacherDataController(); IEnumerable <Teacher> Teachers = controller.ListTeachers(); return(View(Teachers)); }
//GET : /Teacher/DeleteConfirm/{id} public ActionResult DeleteConfirm(int id) { TeacherDataController controller = new TeacherDataController(); Teacher NewTeacher = controller.FindTeacher(id); return(View(NewTeacher)); }
//GET : /Teacher/Show/{id} public ActionResult Show(int id) { TeacherDataController controller = new TeacherDataController(); Teacher NewTeacher = controller.FindTeacher(id); Debug.WriteLine(NewTeacher); return(View(NewTeacher)); }
public ActionResult Create(string TeacherFname, string TeacherLname, string EmployeeNumber, DateTime HireDate, double Salary) { //Identify the inputs provided from the form Debug.WriteLine("I have accessed the Create Method!"); Debug.WriteLine(TeacherFname); Debug.WriteLine(TeacherLname); Teacher NewTeacher = new Teacher(); NewTeacher.TeacherFname = TeacherFname; NewTeacher.TeacherLname = TeacherLname; NewTeacher.EmployeeNumber = EmployeeNumber; NewTeacher.HireDate = HireDate; NewTeacher.Salary = Salary; TeacherDataController controller = new TeacherDataController(); controller.AddTeacher(NewTeacher); return(RedirectToAction("List")); }