private void button3_Click(object sender, EventArgs e) { try { int rowindex = dataGridView1.CurrentCell.RowIndex; string employeeid = dataGridView1.Rows[rowindex].Cells[0].Value.ToString(); addEditEmployee a = new addEditEmployee(1, employeeid); a.ShowDialog(); } catch (Exception ex) { MessageBox.Show("Please choose the data first!"); } }
private void button2_Click(object sender, EventArgs e) { addEditEmployee a = new addEditEmployee(0, ""); a.ShowDialog(); }