Beispiel #1
0
 private void BtnNovo_Click(object sender, EventArgs e)
 {
     StaFormEdicao = true;
     Paginas.SelectTab(1);
     LimpaDados();
     FrmPrincipal.ControleBotoes(true);
     TxtCaixa.Focus();
 }
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (Op == null)
         {
             val1          = Convert.ToInt16(TxtCaixa.Text);
             Result        = val1;
             TxtCaixa.Text = "";
             TxtCaixa.Focus();
             Op = "*";
         }
         else
         {
             if (Op == "*")
             {
                 val2          = Convert.ToInt16(TxtCaixa.Text);
                 Result        = Result * val2;
                 TxtCaixa.Text = "";
                 TxtCaixa.Focus();
                 Op = "*";
             }
             if (Op == "-")
             {
                 val2          = Convert.ToInt16(TxtCaixa.Text);
                 Result        = Result - val2;
                 TxtCaixa.Text = "";
                 TxtCaixa.Focus();
                 Op = "*";
             }
             if (Op == "+")
             {
                 val2          = Convert.ToInt16(TxtCaixa.Text);
                 Result        = Result + val2;
                 TxtCaixa.Text = "";
                 TxtCaixa.Focus();
                 Op = "*";
             }
             if (Op == "/")
             {
                 val2          = Convert.ToInt16(TxtCaixa.Text);
                 Result        = Result / val2;
                 TxtCaixa.Text = "";
                 TxtCaixa.Focus();
                 Op = "*";
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Valor incorreto");;
     }
 }
Beispiel #3
0
 private void BtnEditar_Click(object sender, EventArgs e)
 {
     if (GridDados.CurrentRow == null)
     {
         Paginas.SelectTab(0);
         MessageBox.Show("Não existe Registro para Edição", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         PopularCampos(int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString()));
         StaFormEdicao = true;
         FrmPrincipal.ControleBotoes(true);
         TxtCaixa.Focus();
     }
 }
Beispiel #4
0
 private void BtnGravar_Click(object sender, EventArgs e)
 {
     if (TxtCaixa.Text.Trim() != "")
     {
         Caixa.IdCaixa = int.Parse(TxtCodigo.Text);
         Caixa.Caixa   = TxtCaixa.Text;
         Caixa.GravarDados();
         PopularGrid();
         PopularCampos(Caixa.IdCaixa);
         StaFormEdicao = false;
         FrmPrincipal.ControleBotoes(false);
     }
     else
     {
         MessageBox.Show("Nome do Caixa não Informado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtCaixa.Focus();
     }
 }