/// <summary>
        /// Set the user Test Data
        /// </summary>
        /// <returns></returns>
        private List <User> GetUsers()
        {
            EncryptionManager encryption = new EncryptionManager();
            var text      = encryption.EncryptText("abc");
            var firstUser = new User
            {
                Name       = "X",
                Code       = "X",
                epw        = text,
                Password   = "******",
                User_Group = new User_Group
                {
                    Code          = "Manager",
                    Name          = "Manager",
                    SecurityLevel = 1
                }
            };

            var secondUser = new User
            {
                Name       = "A",
                Code       = "A",
                epw        = text,
                Password   = "******",
                User_Group = new User_Group
                {
                    Code          = "Developer",
                    Name          = "Manager",
                    SecurityLevel = 1
                }
            };
            var users = new List <User>
            {
                firstUser,
                secondUser
            };

            return(users);
        }
Esempio n. 2
0
        /// <summary>
        /// Change Password
        /// </summary>
        /// <param name="modelUserName">User name</param>
        /// <param name="modelPassword">Password</param>
        /// <param name="errorMessage">Error message</param>
        /// <returns>True or false</returns>
        public bool ChangePassword(string modelUserName, string modelPassword, out ErrorMessage errorMessage)
        {
            var encrypt = new EncryptionManager();
            var epw     = encrypt.EncryptText(modelPassword);
            var result  = _loginService.ChangePassword(modelUserName, epw);

            //MsgBox "Successfully Changed Password For the User " & Trim(Me.cbouser.Text), vbOKOnly, "Password Change"
            //Chaps_Main.DisplayMessage(user, (short)66, MsgBoxStyle.OkOnly, cobUser.Text.Trim(), (byte)0); //shiny feb3, 2010 'Trim(cobUser.List(cobUser.ListIndex))
            if (result)
            {
                var offSet = _policyManager.LoadStoreInfo().OffSet;
                errorMessage = new ErrorMessage
                {
                    MessageStyle = _resourceManager.CreateMessage(offSet, 39, 66, modelUserName, MessageType.OkOnly)
                };
            }
            else
            {
                errorMessage = new ErrorMessage();
            }
            return(result);
        }