private void button2_Click(object sender, EventArgs e) { Editar ed = new Editar(); Hide(); ed.Show(); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 6) //make sure button index here { string value = dataGridView1.CurrentRow.Cells["ID"].Value.ToString(); //MessageBox.Show("DEBUG " + value); DialogResult dialogResult = MessageBox.Show("Deseja realmente apagar este funcionário?", "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { deleteEmplyees(value); } } if (e.ColumnIndex == 7) { string value = dataGridView1.CurrentRow.Cells["ID"].Value.ToString(); //MessageBox.Show("DEBUG " + value); Editar editar = new Editar(value); editar.ShowDialog(); } if (e.ColumnIndex == 8) { string value = dataGridView1.CurrentRow.Cells["ID"].Value.ToString(); //MessageBox.Show("DEBUG " + value); detalhar Detalhar = new detalhar(value); Detalhar.ShowDialog(); } }