Ejemplo n.º 1
0
 public bool Check_Slot_Availability(int Vehicle_Type)
 {
     foreach (Slot Single_Slot in Slot_List)
     {
         if (Single_Slot.Return_Slot_Type() == Vehicle_Type && Single_Slot.Check_Slot_Availability() == true)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public int Park_Vehicle(int Parking_Vehicle_Type, string Vehicle_Number)
        {
            int Assigned_Slot_Number = -1;
            int Ticket_Id;

            foreach (Slot Single_Slot in Slot_List)
            {
                if (Single_Slot.Return_Slot_Type() == Parking_Vehicle_Type && Single_Slot.Check_Slot_Availability() == true)
                {
                    Assigned_Slot_Number = Single_Slot.Park_Vehicle();
                    break;
                }
            }
            DateTime Present_Time = DateTime.Now;
            Random   Random_value = new Random();

            Ticket_Id = Random_value.Next(1000, 9999);
            string InTime = Present_Time.ToString();

            Ticket_List.Add(new Ticket(Ticket_Id, InTime, "\0", Assigned_Slot_Number, Vehicle_Number, Parking_Vehicle_Type));
            return(Ticket_Id);
        }