public ActionResult CourseDetail(int courseId)
        {
            CourseViewModel vm = new CourseViewModel();
            //课程
            CourseInfoListDto courseInfo = _courseInfoAppService.GetCourseInfoById(new EntityDto <long>()
            {
                Id = courseId
            });

            courseInfo.Content = System.Web.HttpUtility.HtmlDecode(courseInfo.Content);
            //内训师
            int teacherId = courseInfo.TeacherId;
            var teacher   = _teachersAppService.GetTeachersById(new EntityDto <long>()
            {
                Id = teacherId
            });
            int userId = int.Parse(CookieHelper.GetCookieValue("UserId").ToString());

            //是否已报名
            var boundData = _courseBoundPersonnelAppService.GetCourseBoundByUserIdOrCourseId(userId, courseId);//绑定数据

            if (boundData != null)
            {
                vm.IsSingleUp = true;
            }
            else
            {
                vm.IsSingleUp = false;
            }
            if (courseInfo.Status == 4)
            {
                vm.IsComplete = true;
            }
            else
            {
                vm.IsComplete = false;
            }
            vm.teacher    = teacher;
            vm.CourseInfo = courseInfo;
            vm.CourseId   = courseId;
            return(View(vm));
        }
        public ActionResult SetBoundCourseByUser(int courseId, string userIds)
        {
            var result = new resultData();

            result.status = "-1";
            var userListId = userIds.Split(',').ToList();//用户的Id
            var list       = new List <string>();
            var listLraen  = new List <string>();
            var courseDate = courseInfoService.GetCourseInfoById(new EntityDto <long>()
            {
                Id = courseId
            });                                                                                           //课程数据

            if (courseDate != null && userListId != null && userListId.Any())
            {
                if (courseDate.Status != (int)CourseStatus.Pending)
                {
                    return(Content(Serialize(new resultData()
                    {
                        status = "-1", msg = "当前课程状态为:待审核,才能添加人员"
                    })));
                }
                foreach (var id in userListId)
                {
                    var userData = userAccountService.GetUserAccountById(new EntityDto <long>()
                    {
                        Id = Convert.ToInt32(id)
                    });                                                                                                                  //用户数据
                    var boundData = courseBoundService.GetCourseBoundByUserIdOrCourseId(userData.SysNO, Convert.ToInt32(courseDate.Id)); //绑定数据
                    if (boundData == null)                                                                                               //如果没就增加
                    {
                        //增加人员
                        var create = new CourseBoundPersonnelEditDto();
                        create.AccountSysNo    = userData.SysNO;
                        create.AccountUserName = userData.DisplayName;
                        create.CourseId        = Convert.ToInt32(courseDate.Id);
                        create.CourseName      = courseDate.CourseName;
                        courseBoundService.CreateCourseBoundPersonnel(create);
                    }
                    else
                    {
                        list.Add(userData.DisplayName);
                    }

                    var configu = configureTypeService.GetCTypeByCIdOrType((int)courseDate.Id, (int)ConfigureType.Personal, userData.SysNO);
                    //增加关系
                    if (configu == null)
                    {
                        var createConfigure = new CourseBoundConfigureTypeEditDto();
                        createConfigure.CourseId     = (int)courseDate.Id;
                        createConfigure.CourseName   = courseDate.CourseName;
                        createConfigure.type         = (int)ConfigureType.Personal;
                        createConfigure.BusinessId   = userData.SysNO;
                        createConfigure.BusinessName = userData.DisplayName;
                        configureTypeService.CreateCourseBoundConfigureType(createConfigure);
                    }
                }
                result.status = "0";
                result.msg    = string.Join(",", list);
            }
            return(Content(Serialize(result)));
        }