Пример #1
0
        /// <summary>
        /// 班级列表查询
        /// </summary>
        public ActionResult Classes(ClassesListSearchModel search)
        {
            ClassesListViewModel model = new ClassesListViewModel();                                                           //页面模型

            model.search             = search;                                                                                 //页面的搜索模型
            model.search.PageSize    = 15;                                                                                     //每页显示
            model.search.CurrentPage = Convert.ToInt32(Request["pageindex"]) <= 0 ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页



            //下拉项
            List <CommonEntity> SourceIL = CommonData.GetDictionaryList(5);//授课方式

            model.SourceIL = CommonData.Instance.GetBropDownListData(SourceIL);

            //下拉项
            List <CommonEntity> SourceIL1 = CommonData.GetCourseList();//课程

            model.SourceIL1 = CommonData.Instance.GetBropDownListData(SourceIL1);

            //下拉项
            List <CommonEntity> SourceIL2 = CommonData.GetTeachersList();//获取老师信息

            model.SourceIL2 = CommonData.Instance.GetBropDownListData(SourceIL2);


            //下拉项
            List <CommonEntity> SourceIL3 = CommonData.GetDictionaryList(11);//获取教室信息

            model.SourceIL3 = CommonData.Instance.GetBropDownListData(SourceIL3);


            //下拉项
            List <CommonEntity> SourceIL4 = CommonData.GetDictionaryList(8);//获取上课的时段信息

            model.SourceIL4 = CommonData.Instance.GetBropDownListData(SourceIL4);
            //获取升级班级列表下拉框,只能是未排课的班级列表
            List <CommonEntity> UpgradeClassesIL = CommonData.GetClassesItemList();

            model.UpgradeClassesIL = CommonData.Instance.GetBropDownListData(UpgradeClassesIL);



            //分校下拉项
            List <CommonEntity> ComCodeIL = CommonData.Get_SYS_Company_COMP_Code(UserSession.comcode);//分校

            model.ComCodeIL        = CommonData.Instance.GetBropDownListData_Choice(ComCodeIL);
            model.search.ComCodeIL = CommonData.Instance.GetBropDownListData_Choice(ComCodeIL);


            if (UserSession.comcode != null && UserSession.comcode != "1")
            {
                search.ComCode = UserSession.comcode;//默认查询当前分校的人员
            }

            model.Classeslist = ClassesData.GeClassesList(search); //填充页面模型数据
            return(View(model));                                   //返回页面模型
        }
Пример #2
0
        public async Task <IActionResult> ClassesList()
        {
            var viewModel = new ClassesListViewModel();
            var classes   = await GetClassesBasedOnUserRoleAsync();

            if (classes == null)
            {
                return(RedirectToAction("Error", "Home"));
            }

            viewModel.Classes = classes;

            return(View(viewModel));
        }