示例#1
0
        public bool updateStatus(int _recordID, CCSAFStatus _status, int _retrycount = -1)
        {
            if (retry_count < 0 && _status != CCSAFStatus.P)
            {
                CreditCardSAF _tempSAFInfo = GetCCSAFRecord(_recordID);
                _retrycount = _retrycount - 1;
            }

            CreditCardSAF _SAFInfo = new CreditCardSAF();

            _SAFInfo.recordid     = _recordID;
            _SAFInfo.is_processed = _status.ToString();

            if (_status != CCSAFStatus.P)
            {
            }
            else
            {
                _SAFInfo.last_retry_time = "SYSDATE";
                _SAFInfo.retry_count     = _retrycount - 1;
            }

            bool updated = _SAFInfo.Update();

            return(updated);
        }
示例#2
0
        public bool markAsProcessed()
        {
            CreditCardSAF _SAFInfo = new CreditCardSAF();

            _SAFInfo.recordid        = recordid;
            _SAFInfo.is_processed    = CCSAFStatus.Y.ToString();
            _SAFInfo.last_retry_time = "SYSDATE";

            bool updated = _SAFInfo.Update();

            return(updated);
        }
示例#3
0
        public CreditCardSAF GetCCSAFRecord(int record_id)
        {
            string MethodName = MethodBase.GetCurrentMethod().Name;

            DbDataReader _dataReader = null;

            ModuleName = this.GetType().Name;

            var list = new List <CreditCardSAF>();

            try
            {
                Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO);
                CreditCardSAF _ccSafInfo = new CreditCardSAF();
                _ccSafInfo.recordid = record_id;
                string sqlQuery = _ccSafInfo.prepareSearchStatement();
                list = GetSAFRecordsHelper(sqlQuery);
                Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO);
                if (list != null && list.Count() > 0)
                {
                    return(list[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                if (_dataReader != null)
                {
                    _dataReader.Close();
                }

                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;
            }
        }
示例#4
0
        public bool updateStatus(CCSAFStatus _status)
        {
            CreditCardSAF _SAFInfo = new CreditCardSAF();

            _SAFInfo.recordid     = recordid;
            _SAFInfo.is_processed = _status.ToString();

            if (_status == CCSAFStatus.P)
            {
            }
            else
            {
                _SAFInfo.last_retry_time = "SYSDATE";
                _SAFInfo.retry_count     = retry_count + 1;
            }

            bool updated = _SAFInfo.Update();

            return(updated);
        }
示例#5
0
        private List <CreditCardSAF> GetSAFRecordsHelper(string sqlQuery)
        {
            string MethodName = MethodBase.GetCurrentMethod().Name;

            DbDataReader _dataReader = null;

            var list = new List <CreditCardSAF>();

            try
            {
                Logger.logDebug(ModuleName, MethodName, "**********Entered Method**********", Logger.LOGLEVEL.INFO);

                OledbSqlHelper _dbHelper = new OledbSqlHelper(ODSConnString, bNCRODSConnEncrypted);

                Logger.logDebug(ModuleName, MethodName, "Executing Query : " + sqlQuery, Logger.LOGLEVEL.INFO);

                _dataReader = _dbHelper.ExecuteReader(sqlQuery);

                Logger.logDebug(ModuleName, MethodName, "Query executed. Retrieving Values", Logger.LOGLEVEL.INFO);
                //Change Transamount format to 3 decimals
                Logger.logDebug(ModuleName, MethodName, "Getting NI Decimal Formatting.", Logger.LOGLEVEL.INFO);
                string NIFormat = ConfigurationManager.AppSettings["NIFormat"];
                Logger.logDebug(ModuleName, MethodName, "NI Decimal Formatting : " + NIFormat, Logger.LOGLEVEL.INFO);

                if (_dataReader != null)
                {
                    if (_dataReader.HasRows)
                    {
                        int irow = 0;

                        while (_dataReader.Read())
                        {
                            CreditCardSAF _ccSAF = new CreditCardSAF();

                            _ccSAF.ni1_account_number = _dataReader["ni1_account_number"].ToString();
                            _ccSAF.ni1_tran_date      = _dataReader["ni1_tran_date"].ToString();
                            _ccSAF.ni1_msmoney_seq    = _dataReader["ni1_msmoney_seq"].ToString();
                            _ccSAF.ni1_tran_journal   = _dataReader["ni1_tran_journal"].ToString();
                            _ccSAF.ni1_tran_time      = _dataReader["ni1_tran_time"].ToString();
                            _ccSAF.ni1_tran_type      = _dataReader["ni1_tran_type"].ToString();
                            _ccSAF.ni1_tran_code      = _dataReader["ni1_tran_code"].ToString();
                            _ccSAF.ni1_tran_sequence  = _dataReader["ni1_tran_sequence"].ToString();
                            _ccSAF.ni1_teller         = _dataReader["ni1_teller"].ToString();
                            _ccSAF.ni1_branch         = _dataReader["ni1_branch"].ToString();
                            _ccSAF.ni1_narrative      = _dataReader["ni1_narrative"].ToString();
                            _ccSAF.ni1_trfr_narr      = _dataReader["ni1_trfr_narr"].ToString();
                            _ccSAF.ni1_promo          = _dataReader["ni1_promo"].ToString();
                            _ccSAF.ni1_trace_flag     = _dataReader["ni1_trace_flag"].ToString();
                            _ccSAF.ni1_tran_amount    = _dataReader["ni1_tran_amount"].ToString();

                            //Change format of transaction amount
                            //Logger.logDebug(ModuleName, MethodName, "*************************** Change Transaction Amount Format. ***************************", Logger.LOGLEVEL.INFO);
                            //string sTransAmt = _ccSAF.ni1_tran_amount;
                            //decimal dTransAmt = decimal.Parse(sTransAmt);
                            //sTransAmt = dTransAmt.ToString(NIFormat);
                            //_ccSAF.ni1_tran_amount = sTransAmt;

                            _ccSAF.ni1_balance       = _dataReader["ni1_balance"].ToString();
                            _ccSAF.extraction_date   = _dataReader["extraction_date"].ToString();
                            _ccSAF.ni_msg_id_seq_num = _dataReader["ni_msg_id_seq_num"].ToString();
                            _ccSAF.ni_resp_date      = _dataReader["ni_resp_date"].ToString();
                            _ccSAF.ni_rep_status     = _dataReader["ni_rep_status"].ToString();
                            _ccSAF.ni_rep_error_cd   = _dataReader["ni_rep_error_cd"].ToString();
                            _ccSAF.ni_rep_error_desc = _dataReader["ni_rep_error_desc"].ToString();
                            _ccSAF.ni_rep_trace      = _dataReader["ni_rep_trace"].ToString();
                            _ccSAF.ni_rep_data_error = _dataReader["ni_rep_data_error"].ToString();
                            _ccSAF.ni_rep_type       = _dataReader["ni_rep_type"].ToString();
                            _ccSAF.ni_trans_ref_id   = _dataReader["ni_trans_ref_id"].ToString();
                            _ccSAF.recordid          = Convert.ToInt32(_dataReader["recordid"].ToString());
                            _ccSAF.retry_count       = Convert.ToInt32(_dataReader["retry_count"].ToString());
                            _ccSAF.last_retry_time   = _dataReader["last_retry_time"].ToString();
                            _ccSAF.original_icm_stan = _dataReader["original_icm_stan"].ToString();
                            _ccSAF.original_icm_date = _dataReader["original_icm_date"].ToString();
                            _ccSAF.is_processed      = _dataReader["is_processed"].ToString();
                            _ccSAF.card_currency     = _dataReader["card_currency"].ToString();

                            list.Add(_ccSAF);
                            //_dataReader.NextResult();
                        }
                    }
                    else
                    {
                        Logger.logDebug(ModuleName, MethodName, "No record found", Logger.LOGLEVEL.INFO);
                    }

                    _dataReader.Close();
                }
                else
                {
                    Logger.logDebug(ModuleName, MethodName, "No Records Founds", Logger.LOGLEVEL.INFO);
                }
                Logger.logDebug(ModuleName, MethodName, "**********Exiting Method**********", Logger.LOGLEVEL.INFO);
                return(list);
            }
            catch (Exception ex)
            {
                if (_dataReader != null)
                {
                    _dataReader.Close();
                }

                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;
            }
            finally
            {
                try
                {
                    Logger.logDebug(ModuleName, MethodName, "disposing data reader", Logger.LOGLEVEL.INFO);
                    _dataReader.Dispose();
                }
                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);
                }
            }

            return(list);
        }