示例#1
0
        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
 void CoolLessonNoticeSync(object obj)
 {
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncLessonNotice();
 }
示例#3
0
 /// <summary>
 /// 爽哥学员课程结果
 /// </summary>
 /// <param name="obj"></param> 
 void CoolCourseSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncCoursrResult();
 }
示例#4
0
 /// <summary>
 /// 爽哥开启学员权限
 /// </summary>
 /// <param name="obj"></param> 
 void CoolAuthSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     coolApi.SyncOpenAuth();
 }
示例#5
0
 /// <summary>
 /// 爽哥学员同步
 /// </summary>
 /// <param name="obj"></param> 
 void CoolSdudentSync(object obj)
 {
     // 定时操作
     ICoolBrotherApi coolApi = new CoolBrotherApi();
     LogHelper.WriteLog("CoolSdudentSync Exec");
     coolApi.SyncStudent();
 }
示例#6
0
        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);
        }