public ActionResult Index()
        {
            #region  拉框数据
            //岗位下拉框
            var jobPostList = _jobPostService.GetJobPostDataList();
            var jobPostItem = new List <SelectListItem>();
            if (jobPostList != null && jobPostList.Any())
            {
                foreach (var item1 in jobPostList)
                {
                    jobPostItem.Add(new SelectListItem {
                        Text = item1.Name, Value = item1.Id.ToString()
                    });
                }
            }
            ViewBag.JobPostData = jobPostItem;
            #endregion

            return(View());
        }
Esempio n. 2
0
        /// <summary>
        /// 获取岗位下拉数据
        /// </summary>
        protected void BindJSel()
        {
            //岗位下拉框
            var jobPostList = jobPostService.GetJobPostDataList();
            var jobPostItem = new List <SelectListItem>();

            if (jobPostList != null && jobPostList.Any())
            {
                foreach (var item in jobPostList)
                {
                    jobPostItem.Add(new SelectListItem {
                        Text = item.Name, Value = item.Id.ToString()
                    });
                }
            }
            ViewBag.JobPostSel = jobPostItem;
        }
Esempio n. 3
0
 public ActionResult EditTeacher(int id)
 {
     #region  拉框
     //岗位下拉框
     var jobPostList = jobPostService.GetJobPostDataList();
     var jobPostItem = new List <SelectListItem>();
     if (jobPostList != null && jobPostList.Any())
     {
         foreach (var item1 in jobPostList)
         {
             jobPostItem.Add(new SelectListItem {
                 Text = item1.Name, Value = item1.Id.ToString()
             });
         }
     }
     ViewBag.JobPostData = jobPostItem;
     #endregion
     var resultDate = teachersService.GetTeachersForEdit(new NullableIdDto <long> {
         Id = id
     });
     return(View(resultDate.Teachers));
 }
Esempio n. 4
0
        public ActionResult Index(int id)
        {
            #region 部门,岗位,班级
            //岗位下拉框
            var jobPostList = jobService.GetJobPostDataList();
            var jobPostItem = new List <SelectListItem>();
            if (jobPostList != null && jobPostList.Any())
            {
                foreach (var item1 in jobPostList)
                {
                    jobPostItem.Add(new SelectListItem {
                        Text = item1.Name, Value = item1.Id.ToString()
                    });
                }
            }
            ViewBag.JobPostData = jobPostItem;

            //班级
            var classes   = classService.GetClassesInfoAll();
            var classItem = new List <SelectListItem>();
            if (classes != null && classes.Any())
            {
                foreach (var item2 in classes)
                {
                    classItem.Add(new SelectListItem {
                        Text = item2.ClassesName, Value = item2.Id.ToString()
                    });
                }
            }
            ViewBag.ClassData = classItem;
            #endregion
            //课程Id
            TempData["CourseId"] = id;
            ViewBag.CourseId     = id;
            return(View());
        }