Exemple #1
0
        private void SADADDataUpload(ulong agreementID, decimal amount, string remarks, string billNumber, string paymentRef)
        {
            try
            {
                #region Call stored Procedure

                using (var command = new Oracle.DataAccess.Client.OracleCommand())
                {
                    command.Connection = OraConnection.GetConnection();
                    if (command.Connection.State != ConnectionState.Open)
                    {
                        command.Connection.Open();
                    }

                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandText = "SADAD_manual_data_upload";

                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("p_Agreementid", Oracle.DataAccess.Client.OracleDbType.Int64)).Value     = agreementID;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("p_Chqamount", Oracle.DataAccess.Client.OracleDbType.Double)).Value      = amount;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("p_remarks", Oracle.DataAccess.Client.OracleDbType.Varchar2, 100)).Value = remarks;

                    Oracle.DataAccess.Client.OracleParameter errorcodeparam = new Oracle.DataAccess.Client.OracleParameter("Error_code", Oracle.DataAccess.Client.OracleDbType.Int32);
                    errorcodeparam.Direction = ParameterDirection.Output;

                    Oracle.DataAccess.Client.OracleParameter errormsgparam = new Oracle.DataAccess.Client.OracleParameter("Error_msg", Oracle.DataAccess.Client.OracleDbType.Varchar2, 100);
                    errorcodeparam.Direction = ParameterDirection.Output;

                    command.Parameters.Add(errorcodeparam);
                    command.Parameters.Add(errormsgparam);

                    command.ExecuteNonQuery();

                    string errorcode    = command.Parameters["Error_code"].Value.ToString();
                    string errorMessage = command.Parameters["Error_msg"].Value.ToString();

                    if (!string.IsNullOrWhiteSpace(errorcode))
                    {
                        if (errorcode.ToLower() != "null")
                        {
                            UnprocessedRec(billNumber, paymentRef);
                            Logger.TrackLogs("Invalid Agreement ID: '" + agreementID + "' with amount : '" + amount + "' , Error Code Message : '" + errorcode + "' , Error Message : '" + errorMessage + "'", "after calling 'SADAD_manual_data_upload' Procedure");
                        }
                    }
                    else
                    {
                        Logger.TrackLogs("Agreement ID: '" + agreementID + "' with amount : '" + amount + "' Added Successfully", "after calling 'SADAD_manual_data_upload' Procedure");
                    }


                    command.Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                UnprocessedRec(billNumber, paymentRef);
                Logger.TrackLogs("Invalid Agreement ID: '" + agreementID + "' with amount : '" + amount + "' , Error Code Message : '" + ex.Source + "' , Error Message : '" + ex.Message + "'", "after calling 'SADAD_manual_data_upload' Procedure");
            }
        }
Exemple #2
0
        private void BankChargeEntry(string transactionType, string channel, decimal amount, string cardType, string customerNo, string customerName, string billNumber, string paymentRef)
        {
            try
            {
                #region Call stored Procedure

                using (var command = new Oracle.DataAccess.Client.OracleCommand())
                {
                    command.Connection = OraConnection.GetConnection();
                    if (command.Connection.State != ConnectionState.Open)
                    {
                        command.Connection.Open();
                    }

                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandText = "trx_bank_charge_entry";

                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("TRX_TYPE", Oracle.DataAccess.Client.OracleDbType.Varchar2)).Value      = transactionType;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("TRX_CHANEL", Oracle.DataAccess.Client.OracleDbType.Varchar2)).Value    = channel;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("TRX_AMT", Oracle.DataAccess.Client.OracleDbType.Decimal, 100)).Value   = amount;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("CARD_TYPE", Oracle.DataAccess.Client.OracleDbType.Varchar2)).Value     = cardType;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("customer_no", Oracle.DataAccess.Client.OracleDbType.Varchar2)).Value   = customerNo;
                    command.Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("CUSTOMER_NAME", Oracle.DataAccess.Client.OracleDbType.Varchar2)).Value = customerName;

                    Oracle.DataAccess.Client.OracleParameter errorcodeparam = new Oracle.DataAccess.Client.OracleParameter("VERROR", Oracle.DataAccess.Client.OracleDbType.Varchar2);
                    errorcodeparam.Direction = ParameterDirection.Output;

                    command.Parameters.Add(errorcodeparam);

                    command.ExecuteNonQuery();

                    string errorMessage = command.Parameters["VERROR"].Value.ToString();
                    if (!string.IsNullOrWhiteSpace(errorMessage))
                    {
                        if (errorMessage.ToLower() != "null")
                        {
                            UnprocessedRec(billNumber, paymentRef);
                            Logger.TrackLogs("Invalid Bank Charge Entry Process for Transaction Type : '" + transactionType + "' , Customer No : '" + customerNo + "' , Customer Name : '" + customerName + "' , Card Type :'" + cardType + "' , Error Message : '" + errorMessage + "'", "after calling 'trx_bank_charge_entry' Procedure");
                        }
                    }
                    else
                    {
                        Logger.TrackLogs("Transaction Type : '" + transactionType + "' , Customer No : '" + customerNo + "' , Customer Name : '" + customerName + "' , Card Type :'" + cardType + "' , Added Successfully", "after calling 'trx_bank_charge_entry' Procedure");
                    }


                    command.Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                UnprocessedRec(billNumber, paymentRef);
                Logger.TrackLogs("Invalid Bank Charge Entry Process for Transaction Type : '" + transactionType + "' , Customer No : '" + customerNo + "' , Customer Name : '" + customerName + "' , Card Type :'" + cardType + "' , Error Message : '" + ex.Message + "'", "after calling 'trx_bank_charge_entry' Procedure");
            }
        }