Esempio n. 1
0
        public ActionResult GetShow(int id)
        {
            TeacherDataController controller = new TeacherDataController();
            Teacher teacher = controller.FindTeacher(id);

            return(View(teacher));
        }
Esempio n. 2
0
        public ActionResult Delete(int id)
        {
            TeacherDataController controller = new TeacherDataController();

            controller.DeleteTeacher(id);
            return(RedirectToAction("List"));
        }
Esempio n. 3
0
        public ActionResult List()
        {
            TeacherDataController controller = new TeacherDataController();
            IEnumerable <Teacher> teachers   = controller.ListTeachers();

            return(View(teachers));
        }
Esempio n. 4
0
        public ActionResult DeleteConfirm(int id)
        {
            TeacherDataController controller = new TeacherDataController();
            Teacher teacher = controller.FindTeacher(id);


            return(View(teacher));
        }
Esempio n. 5
0
        public ActionResult Update(int id)
        {
            TeacherDataController controller = new TeacherDataController();

            Teacher selectedTeacher = controller.FindTeacher(id);

            return(View(selectedTeacher));
        }
Esempio n. 6
0
        public ActionResult Create(string fname, string lname, DateTime date, decimal salary)
        {
            TeacherDataController controller = new TeacherDataController();
            Teacher teacher = new Teacher();

            teacher.teacherFname = fname;
            teacher.teacherLname = lname;
            teacher.hireDate     = Convert.ToDateTime(date);
            teacher.salary       = Convert.ToDecimal(salary);

            controller.AddTeacher(teacher);
            return(RedirectToAction("List"));
        }
Esempio n. 7
0
        public ActionResult Update(int id, string fname, string lname, decimal salary)
        {
            Teacher teacher = new Teacher();

            teacher.teacherId    = id;
            teacher.teacherFname = fname;
            teacher.teacherLname = lname;

            teacher.salary = salary;

            TeacherDataController controller = new TeacherDataController();

            controller.updateTeacher(teacher);

            return(RedirectToAction("GetShow/" + id));
        }