Beispiel #1
0
        public ActionResult CourseAssignTeacher()
        {
            var model = new CourseAssignTeacherViewModel();

            model.DepartmentSelectListItems = _courseRepository.AllDepartment()
                                              .Select(c => new SelectListItem()
            {
                Value = c.Id.ToString(), Text = c.Name
            }).ToList();
            model.TeacherSelectListItems = _courseRepository.AllTeacher()
                                           .Select(c => new SelectListItem()
            {
                Value = c.Id.ToString(), Text = c.Name
            }).ToList();
            model.CourseSelectListItems = _courseRepository.AllCourse()
                                          .Select(c => new SelectListItem()
            {
                Value = c.Id.ToString(), Text = c.Name
            }).ToList();

            //ViewBag.dpl = _courseRepository.AllDepartment().ToList();
            //ViewBag.tl = _courseRepository.AllTeacher().ToList();
            //ViewBag.cl = _courseRepository.AllCourse().ToList();

            ViewBag.Sm = TempData["Sm"];
            ViewBag.Em = TempData["Em"];
            return(View(model));
        }