Beispiel #1
0
        static void Main(string[] args)
        {
            string option;

            do
            {
                Console.WriteLine("a. Sign up");
                Console.WriteLine("b. Login");

                Console.Write("Choose an option: ");
                option = Console.ReadLine();

                switch (option)
                {
                case "a":
                    UserManagement.CreateUser(db);
                    break;

                case "b":
                    Login();
                    break;

                default:
                    Console.WriteLine("Please choose a valid option!");
                    break;
                }
            } while (option != "a" || option != "b");
        }
Beispiel #2
0
        public static void ShowMenuUser()
        {
            string option = "";

            do
            {
                Console.WriteLine("a. Use a computer");
                Console.WriteLine("b. Display all computers");
                Console.WriteLine("c. Logout");
                Console.WriteLine("c. Exit");

                Console.Write("Choose an option: ");
                option = Console.ReadLine();

                switch (option)
                {
                case "a":
                    UserManagement.CreateUser(db);
                    break;

                case "b":
                    UserManagement.RetrieveAllUsers(db);
                    break;

                case "c":
                    // logout user
                    break;

                case "d":
                    Console.WriteLine("Exiting...");
                    break;

                default:
                    Console.WriteLine("Please choose a valid option!");
                    break;
                }
            } while (option != "d");
        }
Beispiel #3
0
        public static void ShowMenuAdmin()
        {
            string option = "";

            do
            {
                Console.WriteLine("a. Add a new user");
                Console.WriteLine("b. Display all users");
                Console.WriteLine("c. Update a new user");
                Console.WriteLine("d. Delete a new user");
                Console.WriteLine("e. Add a new computer");
                Console.WriteLine("f. Display all computers");
                Console.WriteLine("g. Update a new computer");
                Console.WriteLine("h. Delete a new computer");
                Console.WriteLine("i. Use a computer");
                Console.WriteLine("j. Logout");
                Console.WriteLine("k. Exit");

                Console.Write("Choose an option: ");
                option = Console.ReadLine();

                switch (option)
                {
                case "a":
                    UserManagement.CreateUser(db);
                    break;

                case "b":
                    UserManagement.RetrieveAllUsers(db);
                    break;

                case "c":
                    UserManagement.UpdateAnUser(db);
                    break;

                case "d":
                    // delete user
                    break;

                case "e":
                    ComputerManagement.AddNewComputer(db);
                    break;

                case "f":
                    ComputerManagement.DisplayAllComputers(db);
                    break;

                case "g":
                    // update a computer
                    break;

                case "h":
                    // delete a computer
                    break;

                case "i":
                    ComputerManagement.UseAComputer(db);
                    break;

                case "j":
                    // logout
                    break;

                case "k":
                    Console.WriteLine("Exiting...");
                    break;

                default:
                    Console.WriteLine("Please choose a valid option!");
                    break;
                }
            } while (option != "k");
        }