예제 #1
0
 private void FormCadServicos_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F6)
     {
         if (btnConsultaGeral.Enabled)
         {
             LimparCampos();
             OrganizaBotoes();
             butAlterar.Enabled = false;
             FormGridServicos grid = new FormGridServicos(this);
             grid.MdiParent = this.ParentForm;
             grid.Show();
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (e.Shift)
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("+{TAB}");
         }
         else
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("{TAB}");
         }
     }
 }
예제 #2
0
        private void butConsultar_Click(object sender, EventArgs e)
        {
            if (tbCodigo.Text.Length == 0)
            {
                LimparCampos();
                OrganizaBotoes();
                butAlterar.Enabled = false;
                FormGridServicos grid = new FormGridServicos(this);
                grid.MdiParent = this.ParentForm;
                grid.Show();
            }
            else
            {
                ser    = new Servicos();
                ser.Id = Convert.ToInt32(tbCodigo.Text);
                ser.ConsultaServico();
                if (ser.Descricao != null)
                {
                    tbDescricao.Text = ser.Descricao;
                    tbDetalhes.Text  = ser.Detalhes;
                    tbValor.Text     = Convert.ToString(ser.Valor);

                    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;
            FormGridServicos grid = new FormGridServicos(this);

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