Example #1
0
        public ActionBusinessResult DeleteUser(int userId, string modifiedBy)
        {
            var result = UserDA.DeleteUser(userId, modifiedBy);

            if (result > 0)
            {
                this.SetActionSuccess(true);
                AccountManagerBL.AddToAccountForceReLoginCollection(userId);
                ModuleMemoryData.MemoryData.GetCache_represent();
            }

            return(this.SetActionResult(result, KnMessageCode.DeleteUserSuccess));
        }
Example #2
0
        public ActionBusinessResult EditUser(UserInfo userEdit, string GroupId)
        {
            var result = UserDA.EditUser(userEdit, GroupId);

            if (result > 0)
            {
                this.SetActionSuccess(true);
                AccountManagerBL.AddToAccountForceReLoginCollection(userEdit.Id);
                ModuleMemoryData.MemoryData.GetCache_represent();
            }

            return(this.SetActionResult(result, KnMessageCode.EditUserSuccess));
        }
Example #3
0
        public ActionBusinessResult ChangeUserSelfPassword(UserInfo userInfo, string newPassword)
        {
            userInfo.Password   = Encription.EncryptAccountPassword(userInfo.Username, userInfo.Password);
            userInfo.ModifiedBy = userInfo.Username;
            newPassword         = Encription.EncryptAccountPassword(userInfo.Username, newPassword);
            var result = UserDA.ChangeUserPassword(userInfo, newPassword);

            if (result > 0)
            {
                this.SetActionSuccess(true);
                AccountManagerBL.AddToAccountForceReLoginCollection(userInfo.Id);
            }

            return(this.SetActionResult(result, KnMessageCode.ChangePasswordUserSuccess));
        }
Example #4
0
        public ActionBusinessResult DoLoginAccount(string userName, string password, string language)
        {
            var passwordEncrypt = Encription.EncryptAccountPassword(userName, password);
            var result          = this.CheckUserLogin(userName, passwordEncrypt);

            if (this.GetActionSuccess())
            {
                this.LoadAllRolesOfUser();
                this.CurrentUserInfo.HtmlMenu  = this.GetUserHtmlMenu(language);
                this.CurrentUserInfo.LoginTime = DateTime.Now;
                AccountManagerBL.UpdateDicAccountLogin(this.CurrentUserInfo);
            }

            return(result);
        }
Example #5
0
        private ActionBusinessResult CheckUserLogin(string username, string password)
        {
            if (username == "SuperAdmin" && password == "75b3ba793f8ea053e9ae90a3474044a0")
            {
                this.SetActionSuccess(true);
                this.CreateUserSuperAdmin();
                this.SetActionMessage(KnMessageCode.LoginSuccess);
            }
            else
            {
                var result = UserDA.CheckUserLogin(username, password);
                if (result > 0)
                {
                    this.SetActionSuccess(true);
                    this.CreateUserSession(username);
                    AccountManagerBL.RemoveFromAccountForceReLoginCollection(this.CurrentUserInfo.Id);
                }

                var mesageCode = this.GetActionSuccess() ? KnMessageCode.LoginSuccess : KnMessageCode.GetMvMessageByCode(result);
                this.SetActionMessage(mesageCode);
            }

            return(this.GetActionResult());
        }