Beispiel #1
0
 private void ChaveClick(object sender, EventArgs e = null)
 {
     try
     {
         if (_memorias.Error == -1)
         {
             switch (((Botao)sender).Chave)
             {
             case EnumChave.F:
             case EnumChave.G:
             case EnumChave.STO:
             case EnumChave.RCL:
                 _chave = ((Botao)sender).Chave;
                 break;
             }
             SetChaves();
         }
         else
         {
             _memorias.Error = -1;
             SetChaves();
             SetMemorias();
         }
     }
     catch (Exception ex)
     {
         ShowMessage.Erro(ex);
     }
 }
Beispiel #2
0
 private void BotaoClick(object sender, EventArgs e = null)
 {
     try
     {
         Botao botao = (Botao)sender;
         bool  flagPonto;
         bool  flagOperador;
         {
             bool flag1 = _memorias.Armazenamento.PontoPressed;
             bool flag2 = !_botoesOperadores.Exists(t => t.Name == botao.Name);
             bool flag3 = !_botoesNumeros.Exists(t => t.Name == botao.Name);
             flagPonto = flag1 && flag2 && flag3;
         }
         {
             bool flag1 = _memorias.Armazenamento.Operador != EnumOperador.Isento;
             bool flag2 = !_botoesNumeros.Exists(t => t.Name == botao.Name);
             flagOperador = flag1 && flag2;
         }
         if (flagPonto || flagOperador)
         {
             _memorias.Armazenamento.PontoPressed = false;
             _memorias.Armazenamento.Operador     = EnumOperador.Isento;
             _chave = EnumChave.isento;
             SetChaves();
             SetMemorias();
             return;
         }
         if (_memorias.Error == -1)
         {
             if (!_botoesFinanceiros.Exists(t => t.Name == botao.Name))
             {
                 _memorias.ChamarResultadoFin = false;
             }
             try
             {
                 bool flag1 = botao.N != EnumN.isento && _chave == EnumChave.isento;
                 bool flag2 = botao.F != EnumF.isento && _chave == EnumChave.F;
                 bool flag3 = botao.G != EnumG.isento && _chave == EnumChave.G;
                 bool flag4 = botao.STO != EnumSTO.isento && _chave == EnumChave.STO;
                 bool flag5 = botao.RCL != EnumRCL.isento && _chave == EnumChave.RCL;
                 if (flag1 | flag2 | flag3 | flag4 | flag5)
                 {
                     Funcoes(botao);
                 }
             }
             catch (Exception ex)
             {
                 ShowMessage.Erro(ex);
             }
         }
         else
         {
             _memorias.Error = -1;
         }
         {
             bool flag1 = !_memorias.Armazenamento.PontoPressed;
             bool flag2 = _memorias.Armazenamento.Operador == EnumOperador.Isento;
             if (flag1 && flag2)
             {
                 _chave = EnumChave.isento;
             }
         }
         SetChaves();
         SetMemorias();
     }
     catch (Exception ex)
     {
         ShowMessage.Erro(ex);
     }
 }