public ActionResult Department(int departmentId)
        {
            var department = _departmentsProvider.GetDepartment(departmentId).ToViewModel();

            ViewBag.CanBeDestroyed = _departmentDestructor.CanBeDestroyed(departmentId);

            return(PartialView("Partials/_department", department));
        }
Example #2
0
        public JsonResult Courses(int department = 0)
        {
            Department d;

            if (department == 0)
            {
                d = _departmetmentsProvider.GetAllDepartments().First();
            }
            else
            {
                d = _departmetmentsProvider.GetDepartment(department);
            }

            var courses = d.Courses.Select(n => new { Text = n.Name, Value = n.Id });

            return(Json(courses, JsonRequestBehavior.AllowGet));
        }