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

            Student SelectedStudent = controller.FindStudent(id);

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

            Student newStudent = controller.FindStudent(id);

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

            controller.DeleteStudent(id);

            return(RedirectToAction("List"));
        }
예제 #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));
        }
예제 #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"));
        }
예제 #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));
        }