private void editFlightToolStripMenuItem_Click(object sender, EventArgs e) { // Открываем форму изменения выбранного рейса EditFlight NewForm = new EditFlight((Flight)Flights[dataGridView_main.CurrentRow.Index].Clone(), FormRole.Changing, ThisAirport, Airports, Aircrafts); NewForm.ShowDialog(this); // Возвращаем данные if (NewForm.EditFlightIfNotLeft) { Flights[dataGridView_main.CurrentRow.Index] = NewForm.EditFlightThisFlight; } showDataOnDataGridView(FlightTableHeaders, 1); }
private void addFlightToolStripMenuItem_Click(object sender, EventArgs e) { // Открываем форму добавления рейса EditFlight NewForm = new EditFlight((Flight) new Flight().Clone(), FormRole.Adding, ThisAirport, Airports, Aircrafts); NewForm.ShowDialog(this); // Возвращаем данные if (NewForm.EditFlightIfNotLeft) { Flights.Add(NewForm.EditFlightThisFlight); } showDataOnDataGridView(FlightTableHeaders, 1); }