Exemple #1
0
 public void AddTempla(int Identifier, byte[] BytesData)
 {
     // Sobrecarga del metodo para insertar un único Template,
     // adicionalmente asigna el valor del identificador del template
     try
     {
         if (_st_Lic.Length == 0)
         {
             MessageBox.Show("Invalid Lic To work");
         }
         else
         {
             CLNBTN_Tp obj_templatetmp = new CLNBTN_Tp();
             obj_templatetmp.setIdentifier(Identifier);
             obj_templatetmp.setInfoTp(BytesData);
             this.AddTempla(obj_templatetmp);
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla(2)", "", "System.AccessViolationException: " + ex_0.Message, "", "");
     }
     catch (Exception ex_1)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla(2)", "", "System.AccessViolationException: " + ex_1.Message, "", "");
     }
 }
Exemple #2
0
 public void AddTempla(CLNBTN_Tp Datum)
 {
     // Método para asignar un único template al arreglo de la clase
     try
     {
         if (_st_Lic.Length == 0)
         {
             MessageBox.Show("Invalid Lic To work");
         }
         else
         {
             CLNBTN_Tp[] stmps = new CLNBTN_Tp[_Templa.Length];
             System.Array.Copy(_Templa, 0, stmps, 0, _Templa.Length);
             _Templa = new CLNBTN_Tp[_Templa.Length + 1];
             System.Array.Copy(stmps, 0, _Templa, 0, stmps.Length);
             _Templa[_Templa.Length - 1] = Datum;
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "System.AccessViolationException: " + ex_0.Message, "", "");
     }
     catch (ArgumentNullException e)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "ArgumentNullException: " + e.Message, "", "");
     }
     catch (RankException e)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "RankException: " + e.Message, "", "");
     }
     catch (ArrayTypeMismatchException e)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "ArrayTypeMismatchException: " + e.Message, "", "");
     }
     catch (InvalidCastException e)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "InvalidCastException: " + e.Message, "", "");
     }
     catch (ArgumentOutOfRangeException e)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "ArgumentOutOfRangeException: " + e.Message, "", "");
     }
     catch (Exception ex_1)
     {
         _Obj_Log.setOutFileLog(true);
         _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "AddTempla", "", "ArgumentOutOfRangeException: " + ex_1.Message, "", "");
     }
 }
Exemple #3
0
        public void Convert2String(String String2Convert)
        {
            /// Convierte una cadena protocolo en datos para un objeto de tipo caDatosTemplate
            /// en formatos:
            /// TIPO BIOMETRIA|CANT TEMPLATES|TEM1|TEM2..n|tamaTransmit(1024)|CANT CEDUL|CED1|CED2..n
            try
            {
                if (_st_Lic.Length == 0)
                {
                    MessageBox.Show("Invalid Lic To work");
                }
                else
                {
                    int inL_tamano = 0;
                    //int inL_posdato = -1;
                    Char[]   delimitadores    = { '|' };
                    String[] stL_datosmensage = String2Convert.Split(delimitadores);

                    if (stL_datosmensage.Length > 0)
                    {
                        _TemplaType = stL_datosmensage[0];
                        int tamaño;
                        Int32.TryParse(stL_datosmensage[1], out tamaño);
                        inL_tamano = tamaño;
                        _Templa    = new CLNBTN_Tp[inL_tamano];
                        int posgen = 0;
                        for (int i = 0; i < _Templa.Length; i++)
                        {
                            posgen     = i + 2;
                            _Templa[i] = new CLNBTN_Tp();
                            //template[i].tamano = Long.parseLong(sdatosmensage[posgen]);
                            long tempTamaño;
                            long.TryParse(stL_datosmensage[posgen], out tempTamaño);
                            _Templa[i]._InfoSize = tempTamaño;
                        }
                        posgen++;
                        int veltransmision;
                        Int32.TryParse(stL_datosmensage[posgen], out veltransmision);
                        _Size_Templa = veltransmision;
                        posgen++;
                        int datosmensaje;
                        Int32.TryParse(stL_datosmensage[posgen], out datosmensaje);
                        _Id_Pess = new String[datosmensaje];
                        for (int c = 0; c < _Id_Pess.Length; c++)
                        {
                            posgen++;
                            _Id_Pess[c] = stL_datosmensage[posgen];
                        }
                    }
                }
            }
            catch (System.AccessViolationException ex_0)
            {
                _Obj_Log.setOutFileLog(true);
                _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Convert2String", "", "System.AccessViolationException: " + ex_0.Message, "", "");
            }
            catch (Exception e)
            {
                _Obj_Log.setOutFileLog(true);
                _Obj_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Convert2String", "", "Exception: " + e.Message, "", "");
            }
        }