public bool Add(string sourceNetwork) { string MethodName = MethodBase.GetCurrentMethod().Name; ModuleName = this.GetType().Name; bool insert = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); string translatedPIN = getTranslatedPIN(sourceNetwork, PIN); PIN = translatedPIN; //string whereClause = preparePrimaryWhereClause(); string insertSQL = prepareInsertStatement(); string sqlQuery = insertSQL;// +whereClause; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); bNCRODSConnEncrypted = Convert.ToBoolean(ConfigurationManager.AppSettings["NCRODSEncrypted"]); ODSConnString = ConfigurationManager.ConnectionStrings["NCRODS"].ConnectionString; OledbSqlHelper _dbHelper = new OledbSqlHelper(ODSConnString, bNCRODSConnEncrypted); Logger.logDebug(ModuleName, MethodName, "Inserting", Logger.LOGLEVEL.INFO); insert = _dbHelper.ExecuteNonQuery(sqlQuery); Logger.logDebug(ModuleName, MethodName, "Insert Result: " + insert.ToString(), Logger.LOGLEVEL.INFO); return(insert); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); throw ex; } return(true); }
public bool Update() { string MethodName = MethodBase.GetCurrentMethod().Name; ModuleName = this.GetType().Name; bool bUpdated = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); string updateSQL = prepareUpdateStatement(); string whereClause = prepareUpdateWhereClause(); string sqlQuery = updateSQL + whereClause; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); bNCRODSConnEncrypted = Convert.ToBoolean(ConfigurationManager.AppSettings["NCRODSEncrypted"]); ODSConnString = ConfigurationManager.ConnectionStrings["NCRODS"].ConnectionString; OledbSqlHelper _dbHelper = new OledbSqlHelper(ODSConnString, bNCRODSConnEncrypted); Logger.logDebug(ModuleName, MethodName, "Updating", Logger.LOGLEVEL.INFO); //iUpdated = _dbHelper.ExecuteScalarWithRecordsAffected(sqlQuery); bUpdated = _dbHelper.ExecuteNonQuery(sqlQuery); Logger.logDebug(ModuleName, MethodName, "Update Result: " + bUpdated.ToString(), Logger.LOGLEVEL.INFO); return(bUpdated); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); throw ex; } }
public bool Update(string updateSQL = null) { string MethodName = MethodBase.GetCurrentMethod().Name; ModuleName = this.GetType().Name; bool updated = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); if (updateSQL == null || updateSQL == "") { updateSQL = prepareUpdateStatement() + prepareUpdatePrimaryWhereClause(); } Logger.logDebug(ModuleName, MethodName, "Executing Query : " + updateSQL, Logger.LOGLEVEL.INFO); OledbSqlHelper _dbHelper = new OledbSqlHelper(ODSConnString, bNCRODSConnEncrypted); Logger.logDebug(ModuleName, MethodName, "Updating CC SAF Log", Logger.LOGLEVEL.INFO); updated = _dbHelper.ExecuteNonQuery(updateSQL); Logger.logDebug(ModuleName, MethodName, "Update Result: " + updated.ToString(), Logger.LOGLEVEL.INFO); return(updated); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); throw new Exception(ex.Message); } }
private bool InsertCustomer(string IdentityNumber, string EncryptedPIN, string ChannelID, string RelationShipNumber, string createdBy, string AuthorizedBy, string status, string retryAvailable) { string MethodName = MethodBase.GetCurrentMethod().Name; bool inserted = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); //check for IDNumber Masking. If should be maksed then do the masking // Logger.logDebug(ModuleName, MethodName, "Identity Number: " + IdentityNumber, Logger.LOGLEVEL.INFO); Logger.logDebug(ModuleName, MethodName, "Inserting Customer", Logger.LOGLEVEL.INFO); /* * [dbo].[CUSTOMER_PIN_AUTHEN]( * [CUSTOMER_ID] [varchar](50) NOT NULL, * [CHANNEL_GROUP_ID] [varchar](50) NOT NULL, * [RELATIONSHIP_NUM] [varchar](50) NOT NULL, * [TPIN] [varchar](50) NOT NULL, * [RETRY_AVAILABLE] [int] NOT NULL, * [MAX_RETRY_COUNT] [int] NOT NULL, * [LAST_PIN_ENTERED_DATE] [datetime] NULL, * [LAST_PIN_CHANGE_DATE] [datetime] NULL, * [TPIN_FLAG] [varchar](50) NULL, * [PIN_VALUE] [varchar](50) NULL, * [PIN_OFFSET] [varchar](50) NULL, * [RESERVED_1] [varchar](50) NULL, * [RESERVED_2] [varchar](50) NULL, * [RESERVED_3] [varchar](50) NULL, * [STATUS] [varchar](50) NOT NULL, * [CREATED_BY] [varchar](50) NOT NULL, * [CREATED_ON] [datetime] NOT NULL, * [UPDATED_BY] [varchar](50) NULL, * [UPDATED_ON] [datetime] NOT NULL, * [AUTHORIZED_BY] [varchar](50) NULL, * [AUTHORIZED_ON] [datetime] NULL, */ if (createdBy == "") { createdBy = "UNKNOWN SYSTEM GENERATED"; } //string sqlQuery = "INSERT INTO CUSTOMER_PIN_AUTHEN (CUSTOMER_ID, CHANNEL_GROUP_ID, RELATIONSHIP_NUM, TPIN, RETRY_AVAILABLE,MAX_RETRY_COUNT, STATUS,CREATED_BY, CREATED_ON, AUTHORIZED_BY, AUTHORIZED_ON)"; //string queryValues = "VALUES ('" + IdentityNumber + "'," + // "'" + ChannelID + "'," + // "'" + RelationShipNumber + "'," + // "'" + EncryptedPIN + "'," + // "" + retryAvailable + "," + // "" + DefaultMaxRetryCount.ToString() + "," + // "'" + status + "'," + // "'" + createdBy + "'," + // "getdate()," + // "'" + AuthorizedBy + "'," + // "getdate()" + ")"; string sqlQuery = "UPDATE CUSTOMER_PIN_AUTHEN SET "; string queryValues = "TPIN = '" + EncryptedPIN + "'," + " RETRY_AVAILABLE = '" + retryAvailable + "'," + " UPDATED_BY = '" + "ICM" + "'," + " UPDATED_ON = " + "getdate()" + "" + " WHERE RELATIONSHIP_NUM = '" + RelationShipNumber + "'"; sqlQuery = sqlQuery + queryValues; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); if (bInsertMigDB) { OledbSqlHelper _dbHelper = new OledbSqlHelper(NCRODSConnString, bNCRODSConnEncrypted); inserted = _dbHelper.ExecuteNonQuery(sqlQuery); } else { inserted = true; } if (inserted) { writeSuccessQueriestoFile(sqlQuery); } else { writeFailedQueriestoFile(sqlQuery); writeFailedCustomerswithQuerytoFile(IdentityNumber); } Logger.logDebug(ModuleName, MethodName, "Insert Result: " + inserted.ToString(), Logger.LOGLEVEL.INFO); return(inserted); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); MessageBox.Show(ex.Message); throw ex; } }
private bool InsertCustomerPINHistory(string IdentityNumber, string transaltedPIN) { string MethodName = MethodBase.GetCurrentMethod().Name; bool inserted = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); //check for IDNumber Masking. If should be maksed then do the masking // Logger.logDebug(ModuleName, MethodName, "Identity Number: " + IdentityNumber, Logger.LOGLEVEL.INFO); Logger.logDebug(ModuleName, MethodName, "Inserting in PIN History", Logger.LOGLEVEL.INFO); string sqlQuery = "INSERT INTO CUSTOMER_PIN_HISTORY (IDENTITY_NUMBER, PIN, CHANNEL_GROUP_ID, CREATED_BY, CREATED_ON, IS_DELETED)"; string queryValues = "VALUES ('" + IdentityNumber + "'," + "'" + transaltedPIN + "'," + "'" + ConfigurationManager.AppSettings["DEFAULT_MIG_HIST_CHANNEL_GROUP_ID"] + "'," + "'" + ConfigurationManager.AppSettings["DEFAULT_MIG_CREATED_BY"] + "'," + "getdate(), 0" + ")"; sqlQuery = sqlQuery + queryValues; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); if (bInsertMigDB) { OledbSqlHelper _dbHelper = new OledbSqlHelper(DBSourceConnString, bDBSourceConnEncrypted); inserted = _dbHelper.ExecuteNonQuery(sqlQuery); } else { inserted = true; } if (inserted) { writeSuccessPINHistoryQueriestoFile(sqlQuery); } else { writeFailedQueriestoFile(sqlQuery); writeFailedPINHistoryCustomerswithQuerytoFile(IdentityNumber); } Logger.logDebug(ModuleName, MethodName, "Insert Result: " + inserted.ToString(), Logger.LOGLEVEL.INFO); return(inserted); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); MessageBox.Show(ex.Message); throw ex; } }
private bool InsertCustomerPINInfo(NCR.EAI.AUB.Entity.CustomerPINInfo _custPINInfo) { string MethodName = MethodBase.GetCurrentMethod().Name; bool inserted = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); //check for IDNumber Masking. If should be maksed then do the masking // Logger.logDebug(ModuleName, MethodName, "Identity Number: " + _custPINInfo.IDENTITY_NUMBER, Logger.LOGLEVEL.INFO); Logger.logDebug(ModuleName, MethodName, "Inserting Customer", Logger.LOGLEVEL.INFO); string sqlQuery = "INSERT INTO CUSTOMER_PIN_INFO (IDENTITY_NUMBER,CUST_TYPE_CODE,PIN_TYPE_CODE,CUSTOMER_STATUS_CODE,UTILIZED_IVR_RETRIES,MAX_IVR_RETRIES,LAST_PIN_CHANGE_DATE,LAST_PIN_ENTRY_DATE,LAST_SUCCESFUL_AUTH_DATE,LAST_PIN_GENERATION_DATE,LAST_STATUS_UPDATE_DATE,CREATED_BY,CREATED_ON,UPDATED_BY,UPDATED_ON,IS_DELETED,DELETED_BY,DELETED_ON,AUTHORIZED_BY,AUTHORIZED_ON)"; //string sqlQuery = "INSERT INTO CUSTOMER_PIN_INFO (IDENTITY_NUMBER, CUST_TYPE_CODE, PIN_TYPE_CODE, CUSTOMER_STATUS_CODE, UTILIZED_IVR_RETRIES,MAX_IVR_RETRIES, CREATED_BY, CREATED_ON, IS_DELETED)"; //string sqlQuery = "INSERT INTO CUSTOMER_PIN_INFO "; string queryValues = "VALUES ('" + _custPINInfo.IDENTITY_NUMBER + "'," + "'" + _custPINInfo.CUST_TYPE_CODE + "'," + "'" + _custPINInfo.PIN_TYPE_CODE + "'," + "'" + _custPINInfo.CUSTOMER_STATUS_CODE + "'," + "" + _custPINInfo.UTILIZED_IVR_RETRIES + "," + "" + _custPINInfo.MAX_IVR_RETRIES + "," + "'" + _custPINInfo.LAST_PIN_CHANGE_DATE + "'," + "'" + _custPINInfo.LAST_PIN_ENTRY_DATE + "'," + "'" + _custPINInfo.LAST_SUCCESFUL_AUTH_DATE + "'," + "'" + _custPINInfo.LAST_PIN_GENERATION_DATE + "'," + "'" + _custPINInfo.LAST_STATUS_UPDATE_DATE + "'," + "'" + _custPINInfo.CREATED_BY + "'," + "'" + _custPINInfo.CREATED_ON + "'," + "'" + _custPINInfo.UPDATED_BY + "'," + "'" + _custPINInfo.UPDATED_ON + "'," + "" + _custPINInfo.IS_DELETED + "," + "'" + _custPINInfo.DELETED_BY + "'," + "'" + _custPINInfo.DELETED_ON + "'," + "'" + _custPINInfo.AUTHORIZED_BY + "'," + "'" + _custPINInfo.AUTHORIZED_ON + "'" + ")"; sqlQuery = sqlQuery + queryValues; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); if (bInsertMigDB) { OledbSqlHelper _dbHelper = new OledbSqlHelper(DBDestConnString, bDBDestConnEncrypted); inserted = _dbHelper.ExecuteNonQuery(sqlQuery); } else { inserted = true; } if (inserted) { writeSuccessQueriestoFile(sqlQuery); } else { writeFailedQueriestoFile(sqlQuery); writeFailedCustomerswithQuerytoFile(_custPINInfo.IDENTITY_NUMBER); } Logger.logDebug(ModuleName, MethodName, "Insert Result: " + inserted.ToString(), Logger.LOGLEVEL.INFO); return(inserted); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); MessageBox.Show(ex.Message); throw ex; } }
private bool InsertCustomerTPIN(string IdentityNumber, string EncryptedPIN, string ChannelID, string RelationShipNumber, string createdBy, string AuthorizedBy, string status, string retryAvailable) { string MethodName = MethodBase.GetCurrentMethod().Name; bool inserted = false; try { Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO); //check for IDNumber Masking. If should be maksed then do the masking // Logger.logDebug(ModuleName, MethodName, "Identity Number: " + IdentityNumber, Logger.LOGLEVEL.INFO); Logger.logDebug(ModuleName, MethodName, "Inserting Customer", Logger.LOGLEVEL.INFO); /* * [dbo].[CUSTOMER_PIN_AUTHEN]( * [CUSTOMER_ID] [varchar](50) NOT NULL, * [CHANNEL_GROUP_ID] [varchar](50) NOT NULL, * [RELATIONSHIP_NUM] [varchar](50) NOT NULL, * [TPIN] [varchar](50) NOT NULL, * [RETRY_AVAILABLE] [int] NOT NULL, * [MAX_RETRY_COUNT] [int] NOT NULL, * [LAST_PIN_ENTERED_DATE] [datetime] NULL, * [LAST_PIN_CHANGE_DATE] [datetime] NULL, * [TPIN_FLAG] [varchar](50) NULL, * [PIN_VALUE] [varchar](50) NULL, * [PIN_OFFSET] [varchar](50) NULL, * [RESERVED_1] [varchar](50) NULL, * [RESERVED_2] [varchar](50) NULL, * [RESERVED_3] [varchar](50) NULL, * [STATUS] [varchar](50) NOT NULL, * [CREATED_BY] [varchar](50) NOT NULL, * [CREATED_ON] [datetime] NOT NULL, * [UPDATED_BY] [varchar](50) NULL, * [UPDATED_ON] [datetime] NOT NULL, * [AUTHORIZED_BY] [varchar](50) NULL, * [AUTHORIZED_ON] [datetime] NULL, */ if (createdBy == "") { createdBy = "UNKNOWN SYSTEM GENERATED"; } string lastPinChangeDate = ""; string lastPinentryDate = ""; string lastSuccAuthDate = ""; string lastPinGenDate = ""; string lastStatusUpdateDate = ""; string createdOn = ""; string updatedBy = ""; string updatedOn = ""; try { if (bUpdateFromPINInfo) { CustomerPINInfo _tempCustPinInfo = _customerPINInfoList.Where(e => e.IDENTITY_NUMBER == RelationShipNumber).FirstOrDefault(); if (_tempCustPinInfo != null) { if (_tempCustPinInfo.PIN_TYPE_CODE != PIN_TYPE.SPIN.GetHashCode().ToString()) { retryAvailable = "0"; status = "MB"; } Logger.logDebug(ModuleName, MethodName, "Getting last pin change date", Logger.LOGLEVEL.WARNING); lastPinChangeDate = FormatDate(_tempCustPinInfo.LAST_PIN_CHANGE_DATE, DBSourceDateFormat, DBDestDateFormat); Logger.logDebug(ModuleName, MethodName, "Getting last pin entry date", Logger.LOGLEVEL.WARNING); lastPinentryDate = FormatDate(_tempCustPinInfo.LAST_PIN_ENTRY_DATE, DBSourceDateFormat, DBDestDateFormat); Logger.logDebug(ModuleName, MethodName, "Getting last auth date", Logger.LOGLEVEL.WARNING); lastSuccAuthDate = FormatDate(_tempCustPinInfo.LAST_SUCCESFUL_AUTH_DATE, DBSourceDateFormat, DBDestDateFormat); Logger.logDebug(ModuleName, MethodName, "Getting last pin generation date", Logger.LOGLEVEL.WARNING); lastPinGenDate = FormatDate(_tempCustPinInfo.LAST_PIN_GENERATION_DATE, DBSourceDateFormat, DBDestDateFormat); Logger.logDebug(ModuleName, MethodName, "Getting last status update date", Logger.LOGLEVEL.WARNING); lastStatusUpdateDate = FormatDate(_tempCustPinInfo.LAST_STATUS_UPDATE_DATE, DBSourceDateFormat, DBDestDateFormat); createdBy = _tempCustPinInfo.CREATED_BY; createdOn = FormatDate(_tempCustPinInfo.CREATED_ON, DBSourceDateFormat, DBDestDateFormat); updatedBy = _tempCustPinInfo.UPDATED_BY; updatedOn = FormatDate(_tempCustPinInfo.UPDATED_ON, DBSourceDateFormat, DBDestDateFormat); } } } catch (Exception ex) { } if (createdOn == null || createdOn == "") { createdOn = "getdate()"; } if (createdBy == null || createdBy == "") { createdBy = "MIGRATED"; } string sqlQuery = "INSERT INTO CUSTOMER_PIN_AUTHEN (CUSTOMER_ID, CHANNEL_GROUP_ID, RELATIONSHIP_NUM, TPIN, RETRY_AVAILABLE,MAX_RETRY_COUNT, STATUS,CREATED_BY, CREATED_ON, RESERVED_3, AUTHORIZED_BY, AUTHORIZED_ON"; string queryValues = "VALUES ('" + IdentityNumber + "'," + "'" + ChannelID + "'," + "'" + RelationShipNumber + "'," + "'" + EncryptedPIN + "'," + "" + retryAvailable + "," + "" + DefaultMaxRetryCount.ToString() + "," + "'" + status + "'," + "'" + createdBy + "'," + "getdate()," + "'MIGRATED'," + "'" + AuthorizedBy + "'," + "getdate()"; if (updatedOn != "") { sqlQuery += ", UPDATED_ON"; queryValues += ", '" + updatedOn + "'"; } if (updatedBy != "") { sqlQuery += ", UPDATED_BY"; queryValues += ", '" + updatedBy + "'"; } if (lastPinentryDate != "") { sqlQuery += ", LAST_PIN_ENTERED_DATE"; queryValues += ", '" + lastPinentryDate + "'"; } if (lastPinChangeDate != "") { sqlQuery += ", LAST_PIN_CHANGE_DATE"; queryValues += ", '" + lastPinChangeDate + "'"; } sqlQuery = sqlQuery + ")" + queryValues + ")"; Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO); if (bInsertMigDB) { OledbSqlHelper _dbHelper = new OledbSqlHelper(DBDestConnString, bDBDestConnEncrypted); inserted = _dbHelper.ExecuteNonQuery(sqlQuery); } else { inserted = true; } if (inserted) { writeSuccessQueriestoFile(sqlQuery); } else { writeFailedQueriestoFile(sqlQuery); writeFailedCustomerswithQuerytoFile(IdentityNumber); } Logger.logDebug(ModuleName, MethodName, "Insert Result: " + inserted.ToString(), Logger.LOGLEVEL.INFO); return(inserted); } catch (Exception ex) { Logger.logDebug(ModuleName, MethodName, "Exception : " + ex.Message, Logger.LOGLEVEL.INFO); if (ex.InnerException != null) { Logger.logDebug(ModuleName, MethodName, "Inner Exception: " + ex.InnerException.Message, Logger.LOGLEVEL.INFO); } Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO); MessageBox.Show(ex.Message); throw ex; } }