Exemple #1
0
        //GET /Student/Update/
        public ActionResult Update(int id)
        {
            StudentDataController controller = new StudentDataController();

            Student SelectedStudent = controller.FindStudent(id);

            return(View(SelectedStudent));
        }
Exemple #2
0
        public ActionResult DeleteConfirm(int id)
        {
            StudentDataController controller = new StudentDataController();

            Student newStudent = controller.FindStudent(id);

            return(View(newStudent));
        }
Exemple #3
0
        public ActionResult Delete(int id)
        {
            StudentDataController controller = new StudentDataController();

            controller.DeleteStudent(id);

            return(RedirectToAction("List"));
        }
Exemple #4
0
        // 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));
        }
Exemple #5
0
        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"));
        }
Exemple #6
0
        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));
        }