Ejemplo n.º 1
0
        public void OnGet(int id)
        {
            Course = _courseSerervice.GetCourseById(id);
            var groups = _courseSerervice.GetGroupForManageCourse();

            ViewData["Groups"] = new SelectList(groups, "Value", "Text", Course.GroupId);
            List <SelectListItem> subgroup = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "انتخاب کنید", Value = ""
                }
            };

            subgroup.AddRange(_courseSerervice.GetSubGroupForManageCourse(Course.GroupId));
            var subgroups = _courseSerervice.GetSubGroupForManageCourse(Course.GroupId);

            ViewData["SubGroups"] = new SelectList(subgroups, "Value", "Text", Course.SubGroup ?? 0);
            var teachers = _courseSerervice.GetTeachers();

            ViewData["Teachers"] = new SelectList(teachers, "Value", "Text", Course.TeacherId);
            var levels = _courseSerervice.GetLevels();

            ViewData["Levels"] = new SelectList(levels, "Value", "Text", Course.LevelId);

            var status = _courseSerervice.GetStatus();

            ViewData["Statues"] = new SelectList(status, "Value", "Text", Course.StatusId);
        }