private void btnEditTerminal_Click(object sender, RoutedEventArgs e) { Terminal terminal = (Terminal)((Button)sender).Tag; if (!terminal.IsBuilt) { WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2210"), Translator.GetInstance().GetString("MessageBox", "2210", "message"), WPFMessageBoxButtons.Ok); } else { object o = PopUpTerminal.ShowPopUp(terminal); if (o != null) { int gates = (int)o; long price = gates * this.Airport.getTerminalGatePrice(); terminal.extendTerminal(gates); showTerminals(); showContracts(); showGatesInformation(); AirlineHelpers.AddAirlineInvoice(GameObject.GetInstance().HumanAirline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.Purchases, -price); } } }
private void btnTerminal_Click(object sender, RoutedEventArgs e) { Terminal terminal = PopUpTerminal.ShowPopUp(this.Airport) as Terminal; if (terminal != null) { // chs, 2011-01-11 changed so a message for confirmation are shown9han long price = terminal.Gates.NumberOfGates * this.Airport.getTerminalGatePrice() + this.Airport.getTerminalPrice(); if (price > GameObject.GetInstance().HumanAirline.Money) { WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2205"), Translator.GetInstance().GetString("MessageBox", "2205", "message"), WPFMessageBoxButtons.Ok); } else { WPFMessageBoxResult result = WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2206"), string.Format(Translator.GetInstance().GetString("MessageBox", "2206", "message"), terminal.Gates.NumberOfGates, price), WPFMessageBoxButtons.YesNo); if (result == WPFMessageBoxResult.Yes) { this.Airport.addTerminal(terminal); showGatesInformation(); showContracts(); showTerminals(); AirlineHelpers.AddAirlineInvoice(GameObject.GetInstance().HumanAirline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.Purchases, -price); } } } }