Пример #1
0
        //GET: Student/DeleteConfirm/{id}
        public ActionResult DeleteConfirm(int id)
        {
            StudentDataController controller = new StudentDataController();
            Student NewStudent = controller.FindStudent(id);

            return(View(NewStudent));
        }
Пример #2
0
        //GET: Student/Delete/{id}
        public ActionResult Delete(int id)
        {
            StudentDataController controller = new StudentDataController();

            controller.DeleteStudent(id);

            return(RedirectToAction("List"));
        }
Пример #3
0
        //GET: Student/List
        public ActionResult List(string Searchkey = null)
        {
            Debug.WriteLine("The Search key the is inputted is ");
            Debug.WriteLine(Searchkey);
            // get accesss from the Students dataController
            StudentDataController controller = new StudentDataController();
            IEnumerable <Student> Students   = controller.ListStudents(Searchkey);

            return(View(Students));
        }
Пример #4
0
        public ActionResult Add(string StudentFname, string StudentLname, string StudentNumber, DateTime EnrolDate)
        {
            //Indentify the inputs are proivded from the form
            Student NewStudent = new Student();

            NewStudent.StudentFname  = StudentFname;
            NewStudent.StudentLname  = StudentLname;
            NewStudent.StudentNumber = StudentNumber;
            NewStudent.EnrolDate     = EnrolDate;

            StudentDataController controller = new StudentDataController();

            controller.AddStudent(NewStudent);

            return(RedirectToAction("List"));
        }