public ActionResult AddDepartment(Departments department) { DepartmentService departmentService = new DepartmentService(); departmentService.AddDepartments(department); return(RedirectToAction("ListDepartment")); }
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()); }