コード例 #1
0
        protected static void newUser() //Method to create new user
        {
            bool usernameMatch = false;
            bool passwordMatch = false;

            string username = "";
            string password = "";

            Console.Write("Please Enter your Provided User ID: ");
            string  x             = Console.ReadLine().ToUpper();
            Patient systemPatient = Patient.patientUser(x);

            do
            {
                Console.Write("Please enter your desired Username: "******"Please Re-enter the Username: "******"Error | Usernames did not Match");
                }

                if (!Patient_User.checkUser(a))
                {
                    Console.WriteLine("Error | Username already in Use");
                }
                else if (Patient_User.checkUser(a))
                {
                    usernameMatch = true;
                    username      = a;
                }
            }while(usernameMatch == false);
            do
            {
                Console.Write("Please enter a Password: "******"Please Confirm your Password: "******"Error | Passwords did not match");
                }
            } while (passwordMatch == false);

            Patient_User y = new Patient_User(systemPatient, username, password);

            Patient_User.addUser(y);
            userMenu(y); //loads user into main login menu
        }