public static OperationResult tokenTANFetchMatrixValues(LoteType loteType, string lotID, string TokenVendorID) { DataTable _dt = null; TokenTypeBaseParams _tkBaseParams = default(TokenTypeBaseParams); string _masterKey = SAFConfiguration.readMasterKey(); string _exportFilePath = SAFConfiguration.readParameterExternal("ExportFilePath"); SAFLOGGERInMEMORY logger = SAFLOGGERInMEMORY.GetLogString(_exportFilePath + "\\" + lotID.Trim() + ".DAT", false); logger.Clear(); OperationResult result; try { _tkBaseParams = new TokenParamsDAO().loadTokenBaseParams(TokenVendorID); if (_tkBaseParams.TokenTypeBaseParamsID == null || _tkBaseParams.MovingFactorType != TokenMovingFactorType.TransactionAuthenticationNumber) { result = OperationResult.Error; } else { if (OperationResult.Error == new TokensDAO().loadTableWithTokensLot(loteType, lotID, TokenVendorID, TokenMovingFactorType.TransactionAuthenticationNumber, out _dt)) { result = OperationResult.Error; } else { foreach (DataRow row in _dt.Rows) { TokenCryptoData _tkCryptoData = new TokenCryptoData(row[5].ToString(), row[0].ToString(), new CryptoData((long)row[1], row[2].ToString().Trim(), row[3].ToString().Trim(), (row[6] != null) ? row[6].ToString().Trim() : string.Empty), _tkBaseParams); logger.Add(_tkCryptoData.SupplierSerialNumber + ";" + string.Join(";", TokensBaseFunctions.tokenTANMatrixArrayFetch(_tkCryptoData, _masterKey, null))); } logger.Persist(); result = OperationResult.Success; } } } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFCORE", new string[] { "http://sfexpand.SAFCore.TokensBaseFunctions.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = OperationResult.Error; } finally { _dt = null; //TokenCryptoData _tkCryptoData = default(TokenCryptoData); _tkBaseParams = default(TokenTypeBaseParams); } return(result); }
public static OperationResult tokenTANFetchSupplierSerialNumber(LoteType loteType, string lotID, string TokenVendorID) { DataTable _dt = null; TokenTypeBaseParams _tkBaseParams = default(TokenTypeBaseParams); string _exportFilePath = SAFConfiguration.readParameterExternal("ExportFilePath"); SAFLOGGERInMEMORY logger = SAFLOGGERInMEMORY.GetLogString(_exportFilePath + "\\" + lotID.Trim() + "SerialNumbers.TXT", false); logger.Clear(); OperationResult result; try { _tkBaseParams = new TokenParamsDAO().loadTokenBaseParams(TokenVendorID); if (_tkBaseParams.TokenTypeBaseParamsID == null || _tkBaseParams.MovingFactorType != TokenMovingFactorType.TransactionAuthenticationNumber) { result = OperationResult.Error; } else { if (OperationResult.Error == new TokensDAO().tokenSupplierSerialNumbersByLot(loteType, lotID, out _dt)) { result = OperationResult.Error; } else { foreach (DataRow row in _dt.Rows) { logger.Add(row[0].ToString().Trim()); } logger.Persist(); result = OperationResult.Success; } } } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFCORE", new string[] { "http://sfexpand.SAFCore.TokensBaseFunctions.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = OperationResult.Error; } finally { _dt = null; logger = null; _tkBaseParams = default(TokenTypeBaseParams); } return(result); }