Esempio n. 1
0
        //COMPLETE
        //A staff member can book a maximum of 4 slots per day. - DONE
        //The slots must be booked between the school working hours of 9am to 2pm and will always be booked at the start of the hour. - DONE
        //Each room can be booked for a maximum of 2 slots per day. - DONE

        //Create a new slot
        private static void CreateSlot()
        {
            Slot newSlot;

            Console.WriteLine("---Create Slot---");

            Console.Write("Enter room name: ");
            string inputRoom = Console.ReadLine().ToUpper();

            Console.Write("Enter date for slot(dd-MM-yyyy): ");
            string inputDate = Console.ReadLine();

            Console.Write("Enter time for slot (HH:mm): ");
            string inputTime = Console.ReadLine();

            Console.Write("Enter staff ID: ");
            string inputStaffID = Console.ReadLine();

            newSlot = ValidateEngine.ValidateCreateSlot(inputRoom, inputDate, inputTime, inputStaffID);

            if (newSlot == null)
            {
                return;
            }
            else
            {
                var SlotList = new SlotManager();
                SlotList.CreateSlot(newSlot);
                Console.WriteLine("Slot created successfully.");;
            }
        }