コード例 #1
0
        protected static void userLogin() //method for exisiting users to log in
        {
            do
            {
                Console.WriteLine("Please enter your Username: "******"Please enter your Password: ");
                string       password    = Console.ReadLine();
                Patient_User currentUser = Patient_User.loginCheck(new List <string>()
                {
                    username, password
                });

                if (currentUser != null)
                {
                    userMenu(currentUser);
                }
            } while (!constantMenu);
        }
コード例 #2
0
        protected static void userMenu(Patient_User user) //Main menu for patient users
        {
            do
            {
                Console.WriteLine(Environment.NewLine + "Please Select one of the following options:");
                Console.WriteLine("Type R to | Request a Phone Consultation" + Environment.NewLine + "Type V to | View your Requests" + Environment.NewLine + "Type T to | View all Available Treatments");
                Console.WriteLine("Type A to | View all confirmed Apointments" + Environment.NewLine + "Type C to | View your Phone Consultations" + Environment.NewLine + "Type X to | Close the Software");
                string userChoice = Console.ReadLine().ToUpper();

                switch (userChoice)
                {
                case "R":
                    Ticket.newTicket(user);     //method to create request ticket for phone consultation
                    break;

                case "V":
                    Ticket.viewTickets(user);     //method to view all active request tickets
                    break;

                case "T":
                    Treatment.treatmentDisplay();     //method to display all available treatments
                    break;

                case "A":
                    Appointment.patientCheck(user);     //method to view all current appointments
                    break;

                case "C":
                    Consultation.patientView(user);     //method to view all confirmed phone consultations
                    break;

                case "X":
                    Environment.Exit(1);     //close the application
                    break;
                }
            } while (!constantMenu);
        }
コード例 #3
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
        }