예제 #1
0
        private static void approve()
        {
            Console.WriteLine("\n -----------------Confirm/Reject the bookings-----------------------");
            RoomFactory.BookingHistory();
            Console.WriteLine("\n Enter the booking Id to Approve:");
            int ch1 = Convert.ToInt32(Console.ReadLine());

            //           bool Flag = false;


            Console.WriteLine("\n set as the bookingstatus to  1.Unavailable 2.Reserved");
            int ch = Convert.ToInt32(Console.ReadLine());

            //string msg = "confirming failed";
            //BookingStatus fStatus = BookingStatus.UNAVAILABLE;
            //BookingStatus fStatus1 = BookingStatus.RESERVED;
            switch (ch)
            {
            case 1:

                RoomFactory.Setstatus(ch1, BookingStatus.UNAVAILABLE);
                break;

            case 2:
                RoomFactory.Setstatus(ch1, BookingStatus.RESERVED);
                break;

            default:

                break;
            }


            //Console.WriteLine(str);
            //Console.WriteLine(str1);
            //menu();
        }
예제 #2
0
        public static void menu()
        {
            Console.WriteLine("------------------RoomBooking System--------------------------------------");
            Console.WriteLine("\n 1. Admin \n 2. User");
            int inval = Convert.ToByte(Console.ReadLine());

            Console.Clear();
            switch (inval)
            {
            case 1:
                Console.WriteLine("\nWelcome admin\n");
                Console.WriteLine("1. ConfirmBooking \n2. ListallBookings \n3.Pending bookings \n4.Listallmembers");

                int sel = Convert.ToByte(Console.ReadLine());
                switch (sel)
                {
                case 1:
                    approve();
                    menu();
                    break;

                case 2:
                    listAllBookings();
                    menu();
                    break;

                case 3:
                    PendingBooking();
                    menu();
                    break;

                case 4:
                    listallmembers();
                    menu();
                    break;
                }
                break;

            case 2:
                Console.WriteLine("\nWelcome user\n");
                Console.WriteLine("\n1.BookRoom \n2.NewUser Registration \n3.BookingHistory \n4.Exit");
                int usel = Convert.ToByte(Console.ReadLine());
                switch (usel)
                {
                case 1:
                    bookRoom();
                    menu();

                    break;

                case 2:
                    newmember();
                    menu();
                    break;

                case 5:
                    System.Environment.Exit(1);
                    break;

                case 3:
                    RoomFactory.BookingHistory();
                    menu();
                    break;
                }
                break;
            }
        }