Esempio n. 1
0
        public void MainMenu()
        {
            _ProductHandler.ShowExisting();
            int Choice = 0, CustomerChoice = 0;

            while (Choice <= 2)
            {
                Console.WriteLine("Welcome to the Shop");
                Console.WriteLine("1:Staff");
                Console.WriteLine("2:Customer");
                Console.WriteLine("3:Exit");
                Choice = Convert.ToInt32(Console.ReadLine());

                switch (Choice)
                {
                case 1:
                    Console.WriteLine("Enter the Name");
                    string StaffName = Console.ReadLine();
                    int    value     = _AuthenticationHandler.EmployeeLogin(_MarketingPerson);
                    if (value == 1)
                    {
                        Console.WriteLine("1:Add Product");
                        Console.WriteLine("2:Logout");
                        int StaffChoice = Convert.ToInt32(Console.ReadLine());

                        switch (StaffChoice)
                        {
                        case 1: _MarketingPersonHandler.AddItemToProductCatalog(_ProductHandler);
                            break;

                        case 2: break;

                        default: Console.WriteLine("Give a valid option");
                            break;
                        }
                    }
                    break;

                case 2: {
                    Console.WriteLine("---Welcome to E-Shopping---");
                    Console.WriteLine("1.Login");
                    Console.WriteLine("2.Create Account");
                    Console.WriteLine("3.Exit");
                    CustomerChoice = Convert.ToInt32(Console.ReadLine());

                    switch (CustomerChoice)
                    {
                    case 1: int loginValue = _AuthenticationHandler.CustomerLogin(_CustomerHandler);
                        if (loginValue == 1)
                        {
                            CustomerOptions();
                        }
                        else
                        {
                            Console.WriteLine("Account Does not exist , PLease Create a Accounr");
                        }
                        break;

                    case 2: _CustomerHandler.CreateAccount();

                        break;

                    default: Console.WriteLine("Thank You");
                        break;
                    }
                }
                break;

                default: break;
                }
            }
        }