public void removeTerminal(AirportTerminalMVVM terminal) { Airport.RemoveTerminal(terminal.Terminal); Terminals.Remove(terminal); var contracts = new List<ContractMVVM>(Contracts); foreach (ContractMVVM contract in contracts) { if (!Airport.AirlineContracts.Exists(c=>contract.Contract == c)) Contracts.Remove(contract); } }
//removes a terminal from the airport public void removeTerminal(AirportTerminalMVVM terminal) { this.Airport.removeTerminal(terminal.Terminal); this.Terminals.Remove(terminal); }
public void purchaseTerminal(AirportTerminalMVVM terminal, Airline airline) { terminal.purchaseTerminal(airline); foreach (AirportContract contract in Airport.AirlineContracts) { if (Contracts.FirstOrDefault(c=>c.Contract == contract) == null) Contracts.Add(new ContractMVVM(contract)); } }