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

            FR_L3BA_GBAPfBP_1535 functionReturn = new FR_L3BA_GBAPfBP_1535();

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

                functionReturn = Execute(Connection, Transaction, 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_BookingAccounts_Purpose_for_BP", ex);
            }
            return(functionReturn);
        }
Exemple #2
0
        protected static FR_L3BA_GBAPfBP_1535 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L3BA_GBAPfBP_1535();
            //Put your code here
            var result = new L3BA_GBAPfBP_1535();

            var tenantBP = CL1_CMN_BPT.ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction,
                                                                                    new CL1_CMN_BPT.ORM_CMN_BPT_BusinessParticipant.Query
            {
                IsTenant = true,
                IfTenant_Tenant_RefID = securityTicket.TenantID,
                Tenant_RefID          = securityTicket.TenantID
            }).Single().CMN_BPT_BusinessParticipantID;

            Guid currentFiscalYearID = CL2_FiscalYear.Complex.Retrieval.cls_Get_Current_FiscalYear.Invoke(Connection, Transaction, securityTicket).Result.ACC_FiscalYearID;

            // bookingtypsAssignment
            var bookingAccountAssignmentParam = new CL3_BookingAccounts.Atomic.Retrieval.P_L3BA_GBAPBPAfBP_1717
            {
                FiscalYearID = currentFiscalYearID,
                BusinessParticipantID_List = new Guid[] { tenantBP }
            };


            var res_BookingAccountAssignment = CL3_BookingAccounts.Atomic.Retrieval.cls_Get_BookingAccount_Purpose_BPAssignment_for_BPID_List.Invoke(
                Connection, Transaction, bookingAccountAssignmentParam, securityTicket).Result;

            // bookingAccounts

            var bookingAccountParam = new CL3_BookingAccounts.Atomic.Retrieval.P_L3BA_GBAfTaFYI_0930
            {
                FiscalYearID = currentFiscalYearID
            };

            var res_BookingAccounts = CL3_BookingAccounts.Atomic.Retrieval.cls_Get_BookingAccounts_for_TenantID_and_FiscalYearID.Invoke(
                Connection, Transaction, bookingAccountParam, securityTicket).Result;


            result.BookingAccountsAssignment = new L3BA_GBAPBPAfBP_1717[res_BookingAccountAssignment.Count()];
            result.BookingAccountsAssignment = res_BookingAccountAssignment;

            result.BookingAccounts = new L3BA_GBAfTaFYI_0930[res_BookingAccounts.Count()];
            result.BookingAccounts = res_BookingAccounts;

            result.BusinessParticipantID = tenantBP;

            returnValue.Result = result;
            return(returnValue);

            #endregion UserCode
        }