private void addButton_Click(object sender, EventArgs e) { EditFlightForm myForm = new EditFlightForm(); myForm.act = EditFlightForm.Action.Insert; if (myForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { flightListControl1.ReloadFlightList(); } }
private void editButton_Click(object sender, EventArgs e) { if (flightListControl1.SelectedFlight > 0) { EditFlightForm myForm = new EditFlightForm(); myForm.act = EditFlightForm.Action.Update; myForm.Flight.GetFlight(flightListControl1.SelectedFlight); if (myForm.Flight.e == null) { if (myForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { flightListControl1.ReloadFlightList(); } } else if (myForm.Flight.e != null) { MessageBox.Show("Неможливо відредагувати даний запис", "Ooooppps!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (flightListControl1.SelectedFlight == 0) { MessageBox.Show("Виберіть рейс.", "Ooooppps!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }