//GET /Student/Update/ public ActionResult Update(int id) { StudentDataController controller = new StudentDataController(); Student SelectedStudent = controller.FindStudent(id); return(View(SelectedStudent)); }
public ActionResult DeleteConfirm(int id) { StudentDataController controller = new StudentDataController(); Student newStudent = controller.FindStudent(id); return(View(newStudent)); }
public ActionResult Delete(int id) { StudentDataController controller = new StudentDataController(); controller.DeleteStudent(id); return(RedirectToAction("List")); }
// GET: /Student/List public ActionResult List(string SearchKey = null) { //debug comments for searching the student table Debug.WriteLine("The input search key is "); Debug.WriteLine(SearchKey); StudentDataController controller = new StudentDataController(); IEnumerable <Student> Students = controller.ListStudents(SearchKey); return(View(Students)); }
public ActionResult Create(string StudentFname, string StudentLname, string StudentNum) { Student newStudent = new Student(); newStudent.StudentFname = StudentFname; newStudent.StudentLname = StudentLname; newStudent.StudentNum = StudentNum; StudentDataController controller = new StudentDataController(); controller.AddStudent(newStudent); return(RedirectToAction("List")); }
public ActionResult Update(int id, string StudentFname, string StudentLname, string StudentNum) { Debug.WriteLine("The updated info received is " + StudentFname + " " + StudentLname + " " + StudentNum); Student StudentInfo = new Student(); StudentInfo.StudentId = id; StudentInfo.StudentFname = StudentFname; StudentInfo.StudentLname = StudentLname; StudentInfo.StudentNum = StudentNum; StudentDataController controller = new StudentDataController(); controller.UpdateStudent(StudentInfo); return(RedirectToAction("Show/" + id)); }