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