예제 #1
0
        private static bool ValidateRegistration(string password)
        {
            var cleanPassword = StringHelper.CleanInput(password);

            if (!Validation.MinStringLength(cleanPassword, 5))
            {
                return(false);
            }

            Password = cleanPassword;

            var dataInterface = new DataInterface();
            var output        = dataInterface.AddUser(Username, Password);

            if (output)
            {
                var user = dataInterface.GetUser(Username, Password);
                Validation.RenderSuccess($"You have registered the user '{user.Username}'!  Press any key to continue.");
                Console.ReadLine();
                return(true);
            }

            Validation.RenderError("We ran into an error trying to create your user.");
            return(false);
        }