예제 #1
0
 private void txtID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         e.Handled = true;
         if (txtID.Text == "")
         {
             wp_Incluir         = true;
             btnExcluir.Enabled = false;
             gpoDados.Enabled   = true;
             txtDescricao.Focus();
         }
         else
         {
             if (Fpg.Consulta(int.Parse(txtID.Text)))
             {
                 BuscaDadosClasse();
                 gpoDados.Enabled   = true;
                 btnExcluir.Enabled = true;
                 txtDescricao.Focus();
             }
             else
             {
                 MessageBox.Show("ID desta FORMA DE PAGAMENTO não encontrado !");
                 txtID.Focus();
             }
         }
     }
 }
예제 #2
0
        private void txtFormaPagamento_KeyPress(object sender, KeyPressEventArgs e)
        {
            Fun.AnalisaInteiro(e);
            if (e.KeyChar == 13)
            {
                e.Handled = true;

                if (Fpg.Consulta(int.Parse(txtFormaPagamento.Text)))
                {
                    lblFormaPagamento.Text = Fpg.Descricao.ToString();
                    txtDescontoPorc.Focus();
                }
                else
                {
                    lblFormaPagamento.Text = "Forma não encontrada !";
                    txtFormaPagamento.Focus();
                }
            }
        }