private void btnCadastrarNovo_Click(object sender, EventArgs e) { FormCadastroSubFuncao form = new FormCadastroSubFuncao(); form.updateFuncao = false; form.ShowDialog(); }
private void dgSubFuncoes_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { FormCadastroSubFuncao form = new FormCadastroSubFuncao(); idSubFuncao = Convert.ToInt32(dgSubFuncoes.Rows[e.RowIndex].Cells["idSubFuncao"].Value.ToString()); descricao = dgSubFuncoes.Rows[e.RowIndex].Cells["descricao"].Value.ToString(); form.idSubFuncao = idSubFuncao; form.txtDescricao.Text = descricao; form.updateFuncao = true; form.funcao = dgSubFuncoes.Rows[e.RowIndex].Cells["descricaoFuncao"].Value.ToString(); form.Show(); }
private void dgFuncoes_CellContentClick(object sender, DataGridViewCellEventArgs e) { //verificar qual a coluna clicada é a de editar if (dgSubFuncoes.Columns[e.ColumnIndex] == dgSubFuncoes.Columns["editar"]) { FormCadastroSubFuncao form = new FormCadastroSubFuncao(); idSubFuncao = Convert.ToInt32(dgSubFuncoes.Rows[e.RowIndex].Cells["idSubFuncao"].Value.ToString()); descricao = dgSubFuncoes.Rows[e.RowIndex].Cells["descricao"].Value.ToString(); form.idSubFuncao = idSubFuncao; form.txtDescricao.Text = descricao; form.updateFuncao = true; form.funcao = dgSubFuncoes.Rows[e.RowIndex].Cells["descricaoFuncao"].Value.ToString(); form.ShowDialog(); } }