コード例 #1
0
ファイル: StudentController.cs プロジェクト: kylin589/EmePro
        public JsonResult ChangePassword(FormCollection fc)
        {
            var currUser = UserBLL.GetUserById(Convert.ToInt32(fc["pwUserId"]));
            var msg = string.Empty;
            var result = false;

            result = UserBLL.ChangePassword(Convert.ToInt32(fc["pwUserId"]), Utility.SecurityHelper.GetMd5(fc["ConfirmNewPassWord"]));

            //beta 2015.06.10   密码修改成功后调用爽哥接口,将新密码同步至爽哥
            var branchParents = ConfigHelper.GetAppSettingValue("OpenBranchParentIds").ToString();
            var openBranchParentIds = branchParents.Split(new[] { ',' }).Select(p => int.Parse(p)).ToList<int>();
            var currBranch = BranchBLL.GetCurrentBranchListByUserId(currUser.Id);
            //修改密码成功、是学员、并且包括在设定的区域中心之中
            if (result && currUser.UserType == ConvertEnum.UserTypeForStudent && openBranchParentIds.Contains(currBranch.ParentId.Value))
            {
                ICoolBrotherApi coolApi = new CoolBrotherApi();
                coolApi.SyncStudentByUserId(currUser.Id);
            }

            return Json(new { Status = result, Msg = msg }, JsonRequestBehavior.DenyGet);
        }
コード例 #2
0
ファイル: Global.asax.cs プロジェクト: kylin589/EmePro
 void CoolLessonNoticeSync(object obj)
 {
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncLessonNotice();
 }
コード例 #3
0
ファイル: Global.asax.cs プロジェクト: kylin589/EmePro
 /// <summary>
 /// 爽哥学员课程结果
 /// </summary>
 /// <param name="obj"></param> 
 void CoolCourseSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncCoursrResult();
 }
コード例 #4
0
ファイル: Global.asax.cs プロジェクト: kylin589/EmePro
 /// <summary>
 /// 爽哥开启学员权限
 /// </summary>
 /// <param name="obj"></param> 
 void CoolAuthSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncOpenAuth();
 }
コード例 #5
0
ファイル: Global.asax.cs プロジェクト: kylin589/EmePro
 /// <summary>
 /// 爽哥学员同步
 /// </summary>
 /// <param name="obj"></param> 
 void CoolSdudentSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     LogHelper.WriteLog("CoolSdudentSync Exec");
     coolApi.SyncStudent();
 }
コード例 #6
0
ファイル: UserController.cs プロジェクト: kylin589/EmePro
        public JsonResult ChangePassword(Eme.Model.Entity.ChangePasswordModel model)
        {
            var currUser = UserBLL.GetUserById(LoginUserManager.CurrLoginUser.UserId);
            var msg = string.Empty;
            var result = false;

            if (
                !Utility.SecurityHelper.GetMd5(model.OldPassword)
                    .Equals(currUser.Password, StringComparison.CurrentCultureIgnoreCase))
            {
                msg = "原始密码错误!";
                result = false;
            }
            else
            {
                result = UserBLL.ChangePassword(LoginUserManager.CurrLoginUser.UserId, Utility.SecurityHelper.GetMd5(model.NewPassword));
            }

            //beta 2015.06.10   密码修改成功后调用爽哥接口,将新密码同步至爽哥
            var branchParents = ConfigHelper.GetAppSettingValue("OpenBranchParentIds").ToString();
            var openBranchParentIds = branchParents.Split(new[] { ',' }).Select(p => int.Parse(p)).ToList<int>();
            var currBranch = BranchBLL.GetCurrentBranchListByUserId(currUser.Id);
            //修改密码成功、是学员、并且包括在设定的区域中心之中
            if (result && currUser.UserType == ConvertEnum.UserTypeForStudent && openBranchParentIds.Contains(currBranch.ParentId.Value))
            {
                ICoolBrotherApi coolApi = new CoolBrotherApi();
                coolApi.SyncStudentByUserId(currUser.Id);
            }

            return Json(new { Status = result, Msg = msg }, JsonRequestBehavior.DenyGet);
        }