private void bunifuThinButton21_Click(object sender, EventArgs e) { PL.insCompanies frm = new insCompanies(); frm.state = "add"; frm.ShowDialog(); this.dataGridView1.DataSource = comp.fetchCompanyNames(); }
private void bunifuThinButton22_Click(object sender, EventArgs e) { try { PL.insCompanies frm = new insCompanies(); frm.state = "update"; frm.id = Convert.ToInt32(this.dataGridView1.CurrentRow.Cells[0].Value); frm.txtInsComp.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.ShowDialog(); this.dataGridView1.DataSource = comp.fetchCompanyNames(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }