コード例 #1
0
        private void CreateUser()
        {
            var user = new User();

            user.Username = "******";
            user.Password = _secure.EncryptData("test");
            _conn.InsertUser(user);
            _id = _conn.GetUserByName(user.Username).UserId;
        }
コード例 #2
0
        private bool ValidateUser(string username, string password)
        {
            var check = false;
            //Get the user and validate the password matches the DB
            var user = _conn.GetUserByName(username);

            if (user != null)
            {
                var pass = _secure.DecryptData(user.Password);
                if (pass == password)
                {
                    check   = true;
                    _userId = user.UserId;
                }
            }

            return(check);
        }