private void addScheme_Click(object sender, EventArgs e) { schemes.Add(new Scheme()); EditScheme editScheme = new EditScheme(schemes.Last(), drugs); editScheme.ShowDialog(this); }
private void schemesDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if ((sender as DataGridView).CurrentRow.Index < schemes.Count && (sender as DataGridView).CurrentRow != null) { EditScheme editScheme = new EditScheme(schemes[(sender as DataGridView).CurrentRow.Index], drugs); editScheme.ShowDialog(this); } }