private void btnAddCooperation_Click(object sender, RoutedEventArgs e) { object o = PopUpAddCooperation.ShowPopUp(GameObject.GetInstance().HumanAirline, this.Airport.Airport); if (o != null && o is CooperationType) { CooperationType type = (CooperationType)o; if (type.Price < GameObject.GetInstance().HumanAirline.Money) { Cooperation cooperation = new Cooperation(type, GameObject.GetInstance().HumanAirline, GameObject.GetInstance().GameTime); this.Airport.addCooperation(cooperation); } else WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2232"), string.Format(Translator.GetInstance().GetString("MessageBox", "2232", "message")), WPFMessageBoxButtons.Ok); } }
//removes a cooperation from the airport public void removeCooperation(Cooperation cooperation) { this.Cooperations.Remove(cooperation); }
//adds a cooperation to the airport public void addCooperation(Cooperation cooperation) { this.Cooperations.Add(cooperation); }
public CooperationMVVM(Airport airport, Cooperation cooperation) { this.Airport = airport; this.Cooperation = cooperation; }
//removes a cooperation from the airport public void removeCooperation(Cooperation cooperation) { this.Cooperations.Remove(cooperation); this.Airport.removeCooperation(cooperation); }
//adds a cooperation to the airport public void addCooperation(Cooperation cooperation) { this.Cooperations.Add(cooperation); this.Airport.addCooperation(cooperation); AirlineHelpers.AddAirlineInvoice(cooperation.Airline, cooperation.BuiltDate, Invoice.InvoiceType.Purchases, -cooperation.Type.Price); }