private void btnAdd_Click(object sender, EventArgs e) { CRUDPerson crdPer = new CRUDPerson(); crdPer.ShowDialog(this); btnSearch_Click(sender, e); }
private void btnEdit_Click(object sender, EventArgs e) { if (grdNames.Rows.Count > 0) { if (grdNames.CurrentRow.Index > -1) { CRUDPerson crdper = new CRUDPerson(Convert.ToInt32(grdNames.CurrentRow.Cells[4].Value)); crdper.ShowDialog(this); btnSearch_Click(sender, e); } } else { MessageBox.Show("Please select Person", "Error"); btnSearch_Click(sender, e); } }