Example #1
0
        public static void employeeUser()
        {
            //This function executes the part of the program for the employee
            string employeeAction = "";

startEmployee:

            Console.WriteLine("\nM: manage movies\n\nR: manage rooms\n\nE: manage employees\n\nC: manage customers\n\nW: manage reservations\n\nD: manage drinks\n\nS: manage snacks\n\nA: manage subscriptions\n\nV: view sales\n\nQ: logout and/or close the program\n\n");
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            employeeAction          = Console.ReadLine();

            Console.Clear();

            switch (employeeAction)
            {
            case "M":
            case "m":
employeeMovie:

                Console.WriteLine("\nA: add a movie\nV: view all movies\nE: edit a movie\nD: delete a movie\n");
                employeeAction = Console.ReadLine();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Movie.addMovie();
                    goto startEmployee;

                case "V":
                case "v":
                    Movie.viewMovie();
                    goto startEmployee;

                case "E":
                case "e":
                    Movie.editMovie();
                    goto startEmployee;

                case "D":
                case "d":
                    Movie.deleteMovie();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto employeeMovie;
                }

            case "R":
            case "r":
employeeRoom:

                Console.WriteLine("\nA: add a room\nV: view all rooms\nE: edit a room\nD: delete a room\n");
                employeeAction = Console.ReadLine();

                Console.Clear();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Room.addRoom();
                    goto startEmployee;

                case "V":
                case "v":
                    Room.viewRoom();
                    goto startEmployee;

                case "E":
                case "e":
                    Room.editRoom();
                    goto startEmployee;

                case "D":
                case "d":
                    Room.deleteRoom();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto employeeRoom;
                }

            case "E":
            case "e":
employeeManage:

                Console.WriteLine("\nA: add an employee\nV: view all employees\nE: edit an employee\nD: delete an employee\n");
                employeeAction = Console.ReadLine();

                Console.Clear();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Employee.addEmployee();
                    goto startEmployee;

                case "V":
                case "v":
                    Employee.viewEmployee();
                    goto startEmployee;

                case "E":
                case "e":
                    Employee.editEmployee();
                    goto startEmployee;

                case "D":
                case "d":
                    Employee.deleteEmployee();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto employeeManage;
                }

            case "C":
            case "c":
customerEmployee:

                Console.WriteLine("\nA: add a customer\nV: view all customers\nE: edit a customer\nD: delete a customer\n");
                employeeAction = Console.ReadLine();

                Console.Clear();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Customer.addCustomer();
                    goto startEmployee;

                case "V":
                case "v":
                    Customer.viewCustomer();
                    goto startEmployee;

                case "E":
                case "e":
                    Customer.editCustomer();
                    goto startEmployee;

                case "D":
                case "d":
                    Customer.deleteCustomer();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto customerEmployee;
                }

            case "W":
            case "w":
reservationEmployee:

                Console.WriteLine("A: add a reservation");
                employeeAction = Console.ReadLine();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Reservation.AddReservation();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto reservationEmployee;
                }

            case "D":
            case "d":
drinkEmployee:

                Console.WriteLine("\nA: add a drink\nV: view all drinks\nE: edit a drink\nD: delete a drink\n");
                employeeAction = Console.ReadLine();

                Console.Clear();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Drink.AddDrink();
                    goto startEmployee;

                case "V":
                case "v":
                    Drink.viewDrink();
                    goto startEmployee;

                case "E":
                case "e":
                    Drink.editDrink();
                    goto startEmployee;

                case "D":
                case "d":
                    Drink.deleteDrink();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto drinkEmployee;
                }

            case "A":
            case "a":
subscriptionEmployee:

                Console.WriteLine("\nA: add a subscription\nV: view all subscriptions\nE: edit a subscription\nD: delete a subscription\n");
                employeeAction = Console.ReadLine();

                Console.Clear();

                switch (employeeAction)
                {
                case "A":
                case "a":
                    Subscription.addSubscription();
                    goto startEmployee;

                case "V":
                case "v":
                    Subscription.viewSubscription();
                    goto startEmployee;

                case "E":
                case "e":
                    Subscription.editSubscription();
                    goto startEmployee;

                case "D":
                case "d":
                    Subscription.deleteSubscription();
                    goto startEmployee;

                default:
                    Console.WriteLine("Unknown command.");
                    goto subscriptionEmployee;
                }

            case "V":
            case "v":
                Employee.viewSalesEmployee();
                break;

            case "Q":
            case "q":
                shutDown();
                break;

            default:
                Console.WriteLine("Unknown command.");
                goto startEmployee;
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            //Taakverdeling:
            //Wessel: Toevoegen van films en zalen en het weergeven van films en zalen en support bieden. Bepalen wanneer er code in de master branch gaat.
            //Roby: Welkomsscherm
            //Niels: Zoekfunctie
            //Dennis: Inlogscherm
            //Korneel: Film informatie opvraag
            //Iedereen: Zoekfunctie maken voor films (Kijken hoever we komen)

            Program p = new Program();
            Movie   m = new Movie();
            Room    r = new Room();
            Search  s = new Search();

            string titleScherm, action3 = "";

            var arr = new[]
            {
                @"   __      __        _                              _             ____  _                                   ",
                @"   \ \    / /  ___  | |  __   ___   _ __    ___    | |_   ___    |_  / (_)  ___   _ _    ___   _ __    __ _ ",
                @"    \ \/\/ /  / -_) | | / _| / _ \ | '  \  / -_)   |  _| / _ \    / /  | | / -_) | ' \  / -_) | '  \  / _` |",
                @"     \_/\_/   \___| |_| \__| \___/ |_|_|_| \___|    \__| \___/   /___| |_| \___| |_||_| \___| |_|_|_| \__,_|",
                @"                                                                                                            ",
                @"   Press any key to start                                                                                     ",
            };

            Console.WriteLine("\n\n");
            foreach (string line in arr)
            {
                Console.WriteLine(line);
            }
            Console.ReadKey();
            Console.WriteLine("Are you a customer?, Yes or No?");
            titleScherm = Console.ReadLine();
            if (titleScherm == "Yes" || titleScherm == "y" || titleScherm == "Y")
            {
                Console.WriteLine("Enter M to view all movies or L to login into your account");
                action3 = Console.ReadLine();
                if (action3 == "M")
                {
                    m.viewMovie();
                }
                if (action3 == "L")
                {
                    Console.WriteLine("This feature does not exist yet, sorry :(");
                }
            }
            else
            {
                Console.WriteLine("Sorry this feature does not exist yet, sorry :(");
            }

            //s.searchMovie();

            string action0, action1, action2 = "";

            Console.WriteLine("\nWhat will you do? Enter M for movies or R for rooms.");
            action0 = Console.ReadLine();
            if (action0 == "M" || action0 == "m")
            {
                Console.WriteLine("For view all movies enter V. Add a movie enter A. Edit a movie enter E. Delete a movie enter D.");
                action1 = Console.ReadLine();
                if (action1 == "A" || action1 == "a")
                {
                    m.addMovie();
                }
                if (action1 == "E" || action1 == "e")
                {
                    m.editMovie();
                }
                if (action1 == "D" || action1 == "d")
                {
                    m.deleteMovie();
                }
                else
                {
                    m.viewMovie();
                }
            }
            if (action0 == "R" || action0 == "r")
            {
                Console.WriteLine("For view all rooms enter V. Add a room enter A.");
                action2 = Console.ReadLine();
                if (action2 == "A" || action2 == "a")
                {
                    r.addRoom();
                }
                else
                {
                    r.viewRoom();
                }
            }
            else
            {
                Console.WriteLine("Unknown command. Please run again this application.\nIf this message keeps showing on you probably do not understand how this application works.");
            }
        }