private void cadastrarSetor_Click(object sender, EventArgs e) { CadastroSetor cadastroSetor = new CadastroSetor(0); Hide(); cadastroSetor.Show(); }
private void tabela_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == tabela.Columns["Excluir"].Index) { new ControleClass().excluirSetor(Convert.ToInt32(tabela.CurrentRow.Cells[2].Value.ToString())); MessageBox.Show("Usuário Excluído com sucesso!", "Usuário Excluído", MessageBoxButtons.OK, MessageBoxIcon.Information); Preencher(); } else if (e.ColumnIndex == tabela.Columns["Editar"].Index) { CadastroSetor cadastroSetor = new CadastroSetor(Convert.ToInt32(tabela.CurrentRow.Cells[2].Value.ToString())); Hide(); cadastroSetor.Show(); } }