// Add new record. // New window for data input will pop up. private void toolStripButton1_Click(object sender, EventArgs e) { WorkForm workFormCopy = this; AddTrain newTrain = new AddTrain(ref workFormCopy, ref trainDataTable); newTrain.Show(); }
// Add new record. // New window for data input will pop up. private void addNewToolStripMenuItem_Click(object sender, EventArgs e) { WorkForm workFormCopy = this; AddTrain newTrain = new AddTrain(ref workFormCopy, ref trainDataTable); newTrain.Show(); }
// Display train number of each train, // that satisfies particular statement. // In this case station name will // be considered. private void findNumberOfSpecificTrainsToolStripMenuItem_Click(object sender, EventArgs e) { try { if (trainList.trainList.Count == 0) { throw new InvalidOperationException(OPERATION_ON_EMPTY_LIST); } WorkForm workFormCopy = this; FindByStation newForm = new FindByStation(ref workFormCopy); newForm.Show(); } catch (InvalidOperationException ex) { MessageBox.Show(ex.Message, "Empty List", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public FindByStation(ref WorkForm parent) { this.mainForm = parent; InitializeComponent(); }
public FindByStationAndArrivalTime(ref WorkForm parent) { InitializeComponent(); this.mainForm = parent; }
public AddTrain(ref WorkForm wForm, ref DataGridView dataTable) { parent = wForm; trainDataTable = dataTable; InitializeComponent(); }