private void button1_Click(object sender, EventArgs e) { var addedit = new AddEditZdanie(); addedit.ShowDialog(); ini(); isactive(); }
private void button2_Click(object sender, EventArgs e) { if (bgZdania.Rows.Count > 0) { try { var addedit = new AddEditZdanie(bgZdania.SelectedRows[0].Cells["cname"].Value.ToString(), bgZdania.SelectedRows[0].Cells["abbreviation"].Value.ToString(), bgZdania.SelectedRows[0].Cells["ID"].Value.ToString(), true); addedit.ShowDialog(); } catch (Exception r) { MessageBox.Show("Нет записей для редактирования." + "\n" + r.ToString(), "Ошибка"); } } ini(); isactive(); }