private void btnNovo_Click(object sender, EventArgs e) { _op = Operacoes.inserindo; ValidaBotoes(); limpar(this); _objModulo = new mModulos(); gvForms.Columns[singleton.Name].ReadOnly = true; formulariosBindingSource.DataSource = _objModulo.Formularios; }
public int Salvar(mModulos _objModulos) { if (_objModulos.idModulo == 0) { _ctxModulos.AddToentityModulos(_objModulos); } _ctxModulos.SaveChanges(); return(_objModulos.idModulo); }
private void btnPesquisa_Click(object sender, EventArgs e) { UIPesquisaForm _frmPesquisaForm = new UIPesquisaForm(); if (_frmPesquisaForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _op = Operacoes.pesquisando; ValidaBotoes(); _objModulo = new mModulos(); _objModulo = _objBoMod.GetModulo(_frmPesquisaForm.IdMod); edtID.Text = _objModulo.idModulo.ToString(); edtModulo.Text = _objModulo.xNome; edtNamesPrinc.Text = _objModulo.xNameSpaceCamada; formulariosBindingSource.DataSource = _objModulo.Formularios; gvForms.DataSource = formulariosBindingSource; } }
private void btnCancelar_Click(object sender, EventArgs e) { if (edtID.Text == "") { _op = Operacoes.livre; limpar(this); } else { _objModulo = new mModulos(); _objModulo = _objBoMod.GetModulo(Convert.ToInt32(edtID.Text)); edtID.Text = _objModulo.idModulo.ToString(); edtModulo.Text = _objModulo.xNome; edtNamesPrinc.Text = _objModulo.xNameSpaceCamada; formulariosBindingSource.DataSource = _objModulo.Formularios; gvForms.DataSource = formulariosBindingSource; _op = Operacoes.pesquisando; } LimparValid(); gvForms.ShowCellErrors = false; ValidaBotoes(); }