Example #1
0
        public ActionResult AddDepartment(Departments department)
        {
            DepartmentService departmentService = new DepartmentService();

            departmentService.AddDepartments(department);
            return(RedirectToAction("ListDepartment"));
        }
Example #2
0
        public ActionResult CreateDepartmentAndCourse(DepartmentCourseViewModel model)
        {
            DepartmentService departmentService = new DepartmentService();
            Departments       department        = new Departments();

            department.Name   = model.DepartmentName;
            department.Budget = Convert.ToDouble(model.DepartmentBudget);
            departmentService.AddDepartments(department);

            CourseService courseService = new CourseService();
            Courses       course        = new Courses();

            course.Title = model.CourseName;
            courseService.AddCourses(course);

            return(View());
        }