Exemple #1
0
        /// <summary>
        /// Validates login details and logs in the user
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static bool ValidateAndLogin(string username, string password)
        {
            if (IsValidLoginDetails(username, password) == false)
            {
                return(false);
            }

            var user = UsersDataAccess.GetUserByName(username);

            LogInUser(user);

            if (CurrentUser.Login == username)
            {
                return(true);
            }
            return(false);
        }