예제 #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5BK_GBFBID_1447 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5BK_GBFBID_1447 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5BK_GBFBID_1447 functionReturn = new FR_L5BK_GBFBID_1447();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);

                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw new Exception("Exception occured in method cls_Get_Banks_For_BankID", ex);
            }
            return(functionReturn);
        }
예제 #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5BK_GBFBID_1447 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5BK_GBFBID_1447 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
예제 #3
0
        protected static FR_L5BK_GBFBID_1447 Execute(DbConnection Connection, DbTransaction Transaction, P_L5BK_GBFBID_1447 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L5BK_GBFBID_1447();
            returnValue.Result = new L5BK_GBFBID_1447();

            ORM_ACC_BNK_Banks.Query bankQuery = new ORM_ACC_BNK_Banks.Query();
            bankQuery.ACC_BNK_BankID = Parameter.ACC_BNK_BankID;
            bankQuery.Tenant_RefID   = securityTicket.TenantID;
            List <ORM_ACC_BNK_Banks> banks = ORM_ACC_BNK_Banks.Query.Search(Connection, Transaction, bankQuery);
            if (banks.Count == 0)
            {
                return(null);
            }
            else
            {
                L5BK_GBFT_1318 bank = new L5BK_GBFT_1318();
                bank.ACC_BNK_BankID     = banks[0].ACC_BNK_BankID;
                bank.BankName           = banks[0].BankName;
                bank.BankNumber         = banks[0].BankNumber;
                bank.BICCode            = banks[0].BICCode;
                bank.Country_RefID      = banks[0].Country_RefID;
                bank.RoutingNumber      = banks[0].RoutingNumber;
                returnValue.Result.Bank = bank;
            }
            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
예제 #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5BK_GBFBID_1447 Invoke(string ConnectionString, P_L5BK_GBFBID_1447 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
예제 #5
0
        protected static FR_L5BK_GBFBID_1447 Execute(DbConnection Connection, DbTransaction Transaction, P_L5BK_GBFBID_1447 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L5BK_GBFBID_1447();
            returnValue.Result = new L5BK_GBFBID_1447();

            ORM_ACC_BNK_Bank.Query bankQuery = new ORM_ACC_BNK_Bank.Query();
            bankQuery.ACC_BNK_BankID = Parameter.ACC_BNK_BankID;
            bankQuery.Tenant_RefID   = securityTicket.TenantID;
            bankQuery.IsDeleted      = false;
            List <ORM_ACC_BNK_Bank> banks = ORM_ACC_BNK_Bank.Query.Search(Connection, Transaction, bankQuery);
            if (banks == null || banks.Count == 0)
            {
                returnValue.Result = null;
            }
            else
            {
                L5BK_GBFT_1318 bank = new L5BK_GBFT_1318();
                bank.ACC_BNK_BankID = banks[0].ACC_BNK_BankID;
                bank.BankName       = banks[0].BankName;
                bank.BankNumber     = banks[0].BankNumber;
                bank.BICCode        = banks[0].BICCode;

                bank.RoutingNumber       = banks[0].RoutingNumber;
                bank.BankLocationComment = banks[0].BankLocationComment;
                returnValue.Result.Bank  = bank;

                ORM_CMN_Country.Query countryQuery = new ORM_CMN_Country.Query();
                countryQuery.CMN_CountryID = banks[0].Country_RefID;
                countryQuery.IsDeleted     = false;
                countryQuery.Tenant_RefID  = securityTicket.TenantID;

                List <ORM_CMN_Country> countries = ORM_CMN_Country.Query.Search(Connection, Transaction, countryQuery);
                if (countries.Count != 0)
                {
                    bank.Country_ISOCode_Alpha2 = countries[0].Country_ISOCode_Alpha2;
                }
            }
            //Put your code here
            return(returnValue);

            #endregion UserCode
        }