示例#1
0
        public bool SavePmntDetails(PmntDetailsinfo objPmntDetailsinfo, int PackageID, int UID, int CarID)
        {
            string spNameString = string.Empty;

            bool bsucess = false;


            //Setting Connection
            //Global.INSTANCE_NAME = strCurrentConn;

            IDataReader ModelsInfoDataReader = null;


            //Connect to the database
            Database dbDatabase = DatabaseFactory.CreateDatabase(Global.INSTANCE_NAME);

            //Assign stored procedure name

            spNameString = "[Usp_Save_BankDetails]";
            DbCommand dbCommand = null;

            try
            {
                //Set stored procedure to the command object
                dbCommand = dbDatabase.GetStoredProcCommand(spNameString);

                dbDatabase.AddInParameter(dbCommand, "@pmntType", DbType.Int64, objPmntDetailsinfo.PmntType);
                dbDatabase.AddInParameter(dbCommand, "@cardNumber", DbType.String, objPmntDetailsinfo.CardNumber);
                dbDatabase.AddInParameter(dbCommand, "@cardType", DbType.String, objPmntDetailsinfo.CardType);
                dbDatabase.AddInParameter(dbCommand, "@cardExpDt", DbType.String, objPmntDetailsinfo.CardExpDt);
                dbDatabase.AddInParameter(dbCommand, "@cardholderName", DbType.String, objPmntDetailsinfo.CardholderName);
                dbDatabase.AddInParameter(dbCommand, "@cardCode", DbType.String, objPmntDetailsinfo.CardCode);
                dbDatabase.AddInParameter(dbCommand, "@BillingName", DbType.String, objPmntDetailsinfo.BillingName);
                dbDatabase.AddInParameter(dbCommand, "@BillingPhone", DbType.String, objPmntDetailsinfo.BillingPhone);
                dbDatabase.AddInParameter(dbCommand, "@BillingZip", DbType.String, objPmntDetailsinfo.BillingZip);
                dbDatabase.AddInParameter(dbCommand, "@billingAdd", DbType.String, objPmntDetailsinfo.BillingAdd);
                dbDatabase.AddInParameter(dbCommand, "@billingCity", DbType.String, objPmntDetailsinfo.BillingCity);
                dbDatabase.AddInParameter(dbCommand, "@billingState", DbType.String, objPmntDetailsinfo.BillingState);
                dbDatabase.AddInParameter(dbCommand, "@IPAddress", DbType.String, objPmntDetailsinfo.IPAddress);
                dbDatabase.AddInParameter(dbCommand, "@bankRouting", DbType.String, objPmntDetailsinfo.BankRouting);
                dbDatabase.AddInParameter(dbCommand, "@bankName", DbType.String, objPmntDetailsinfo.BankName);
                dbDatabase.AddInParameter(dbCommand, "@bankAccountNumber", DbType.String, objPmntDetailsinfo.BankAccountNumber);
                dbDatabase.AddInParameter(dbCommand, "@AuthorizationDt", DbType.String, objPmntDetailsinfo.AuthorizationDt);
                dbDatabase.AddInParameter(dbCommand, "@Amount", DbType.String, objPmntDetailsinfo.Amount);
                dbDatabase.AddInParameter(dbCommand, "@pmntStatus", DbType.Int32, objPmntDetailsinfo.PmntStatus);
                dbDatabase.AddInParameter(dbCommand, "@PackageID", DbType.Int32, PackageID);
                dbDatabase.AddInParameter(dbCommand, "@UID", DbType.Int32, UID);
                dbDatabase.AddInParameter(dbCommand, "@CarID", DbType.Int32, CarID);


                //Executing stored procedure
                dbDatabase.ExecuteNonQuery(dbCommand);


                bsucess = true;
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, Global.EXCEPTION_POLICY);

                if (rethrow)
                {
                    throw;
                }
            }

            return(bsucess);
        }
示例#2
0
        public bool UpdatePmntStatus(PmntDetailsinfo objPmntDetailsinfo, int PackageID, int UID, int CarID, int UserPackID, int PostingID)
        {
            string spNameString = string.Empty;

            bool bsucess = false;


            //Setting Connection
            //Global.INSTANCE_NAME = strCurrentConn;

            IDataReader ModelsInfoDataReader = null;


            //Connect to the database
            Database dbDatabase = DatabaseFactory.CreateDatabase(Global.INSTANCE_NAME);

            //Assign stored procedure name

            spNameString = "[Usp_Save_PaymentStatus]";
            DbCommand dbCommand = null;

            try
            {
                //@pmntStatus int,
                //@TransactionID varchar(500),
                //@Currency varchar(500),
                //@UID int,
                //@PackageID int,
                //@CarID int
                //Set stored procedure to the command object
                dbCommand = dbDatabase.GetStoredProcCommand(spNameString);

                dbDatabase.AddInParameter(dbCommand, "@Amount", DbType.String, objPmntDetailsinfo.Amount);
                dbDatabase.AddInParameter(dbCommand, "@TransactionID", DbType.String, objPmntDetailsinfo.TransactionID);
                dbDatabase.AddInParameter(dbCommand, "@pmntStatus", DbType.Int32, objPmntDetailsinfo.PmntStatus);
                dbDatabase.AddInParameter(dbCommand, "@PackageID", DbType.Int32, PackageID);
                dbDatabase.AddInParameter(dbCommand, "@UID", DbType.Int32, UID);
                dbDatabase.AddInParameter(dbCommand, "@CarID", DbType.Int32, CarID);
                dbDatabase.AddInParameter(dbCommand, "@pmntType", DbType.Int32, objPmntDetailsinfo.PmntType);
                dbDatabase.AddInParameter(dbCommand, "@IPAddress", DbType.String, objPmntDetailsinfo.IPAddress);
                dbDatabase.AddInParameter(dbCommand, "@UserPackID", DbType.Int32, UserPackID);
                dbDatabase.AddInParameter(dbCommand, "@PostingID", DbType.Int32, PostingID);

                //Executing stored procedure
                dbDatabase.ExecuteNonQuery(dbCommand);


                bsucess = true;
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, Global.EXCEPTION_POLICY);

                if (rethrow)
                {
                    throw;
                }
            }

            return(bsucess);
        }