예제 #1
0
 private void FormCadFuncao_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F6)
     {
         if (btnConsultaGeral.Enabled)
         {
             LimparCampos();
             OrganizaBotoes();
             butAlterar.Enabled = false;
             FormGridFuncao grid = new FormGridFuncao(this);
             grid.MdiParent = this.ParentForm;
             grid.Show();
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (e.Shift)
         {
             SendKeys.Send("+{TAB}");
             e.SuppressKeyPress = true;
         }
         else
         {
             SendKeys.Send("{TAB}");
             e.SuppressKeyPress = true;
         }
     }
 }
예제 #2
0
        private void butConsultar_Click(object sender, EventArgs e)
        {
            if (tbCodigo.Text.Length == 0)
            {
                LimparCampos();
                OrganizaBotoes();
                butAlterar.Enabled = false;
                FormGridFuncao grid = new FormGridFuncao(this);
                grid.MdiParent = this.ParentForm;
                grid.Show();
            }
            else
            {
                func    = new Funcao();
                func.Id = Convert.ToInt32(tbCodigo.Text);
                func.ConsultaFuncao();
                if (func.Descricao != null)
                {
                    tbDescricao.Text = func.Descricao;

                    butAlterar.Enabled = true;
                    butExcluir.Enabled = true;
                }
                else
                {
                    this.LimparCampos();
                    this.OrganizaBotoes();
                }
                tbCodigo.SelectAll();
            }
        }
예제 #3
0
        private void btnConsultaGeral_Click(object sender, EventArgs e)
        {
            LimparCampos();
            OrganizaBotoes();
            butAlterar.Enabled = false;
            FormGridFuncao grid = new FormGridFuncao(this);

            grid.MdiParent = this.ParentForm;
            grid.Show();
        }