public void AddNewPlane(Flight flight) { if (flight.Direction == 1) { lock (WaitingArrivals) { WaitingArrivals.Add(flight.QueryDate, flight); _repo.AddArival(new Arrival { Number = flight.Number, Time = flight.QueryDate }); } } else { lock (WaitingDepartures) { WaitingDepartures.Add(flight.QueryDate, flight); _repo.AddDeparture(new Departure { Number = flight.Number, Time = flight.QueryDate }); } } }