Beispiel #1
0
        //ADMIN COMPLETE SECTION
        private void AdminSection()
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Welcome-to-Admin-Section--------------");
            Console.ForegroundColor = ConsoleColor.White;
            bool adminLoop = true;

            while (adminLoop == true)
            {
                try
                {
                    GetAdminMenu();
                    int adminCase = int.Parse(Console.ReadLine());
                    switch (adminCase)
                    {
                    case 1:
                        BookPL bookSection = new BookPL();
                        bookSection.BookSection();
                        break;

                    case 2:
                        UserPL userSection = new UserPL();
                        userSection.UserSection();
                        break;

                    case 3:
                        RequestedSection();
                        break;

                    case 4:
                        RecievedSection();
                        break;

                    case 5:
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine("Logged out successfully..\nTada have a nice day...");
                        Console.ForegroundColor = ConsoleColor.White;
                        adminLoop = false;
                        break;

                    default:
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Invalid input!!!");
                        Console.ForegroundColor = ConsoleColor.White;
                        break;
                    }
                }
                catch (FormatException)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Sorry try agian once!!!");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                catch (LibraryMSException)
                {
                    throw new LibraryMSException("Some unknown exception is occured..");
                }
            }
        }
Beispiel #2
0
        //INDIVIDUAL USER HOME SCREEN
        private void UserHomeSection(int userId)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Welcome-to-User-Section--------------");
            Console.ForegroundColor = ConsoleColor.White;
            bool userLoop = true;

            while (userLoop == true)
            {
                try
                {
                    GetUserHomeMenu();
                    int userCase = int.Parse(Console.ReadLine());
                    switch (userCase)
                    {
                    case 1:
                        BookPL bookPL = new BookPL();
                        bookPL.GetAllBook();
                        break;

                    case 2:
                        RequestSection(userId);
                        break;

                    case 3:
                        RecieveSection(userId);
                        break;

                    case 4:
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine("Logged out successfully..\nTada have a nice day...");
                        Console.ForegroundColor = ConsoleColor.White;
                        userLoop = false;
                        break;

                    default:
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Invalid input!!!");
                        Console.ForegroundColor = ConsoleColor.White;
                        break;
                    }
                }
                catch (FormatException)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Sorry try agian once!!!");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                catch (LibraryMSException)
                {
                    throw new LibraryMSException("Some unknown exception is occured..");
                }
            }
        }