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

            FR_L5OU_GOUwWT_1346 functionReturn = new FR_L5OU_GOUwWT_1346();

            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_OrgUnits_with_WorkTimes_for_BusinessParticipantID", ex);
            }
            return(functionReturn);
        }
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5OU_GOUwWT_1346 Invoke(string ConnectionString, P_L5OU_GOUwWT_1346 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5OU_GOUwWT_1346 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5OU_GOUwWT_1346 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
        protected static FR_L5OU_GOUwWT_1346 Execute(DbConnection Connection, DbTransaction Transaction, P_L5OU_GOUwWT_1346 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5OU_GOUwWT_1346();

            P_L5OU_GOUNfBPID_1501 ParameterOrgUnitsForBusinessPar = new P_L5OU_GOUNfBPID_1501();
            ParameterOrgUnitsForBusinessPar.BusinessParticipantID = Parameter.BusinessParticipantID;
            var orgUnitsInfoForBusinessParticipantID       = cls_Get_OrgUnitNames_for_BusinessParticipantID.Invoke(Connection, Transaction, ParameterOrgUnitsForBusinessPar, securityTicket).Result.ToArray();
            L5OU_GOUwWT_1346 OrgUnitsNamesAndStandardTimes = new L5OU_GOUwWT_1346();
            OrgUnitsNamesAndStandardTimes.OrgUnitOfficeName = orgUnitsInfoForBusinessParticipantID;
            List <L5OU_GOUwWT_1346StandardTimes> orgUnitsStandardTimesForOfficeID = new List <L5OU_GOUwWT_1346StandardTimes>();
            foreach (var office in orgUnitsInfoForBusinessParticipantID)
            {
                L5OU_GOUwWT_1346StandardTimes StandardTimes = new L5OU_GOUwWT_1346StandardTimes();
                StandardTimes.CMN_STR_OfficeID = office.CMN_STR_OfficeID;
                P_L5OU_GSHfOID_1540 ParameterOrgUnitStandardTime = new P_L5OU_GSHfOID_1540();
                ParameterOrgUnitStandardTime.OfficeID = office.CMN_STR_OfficeID;
                L5OU_GSHfOID_1540[] orgUnitStandardTimes = cls_Get_StandardHours_for_OfficeID.Invoke(Connection, Transaction, ParameterOrgUnitStandardTime, securityTicket).Result;
                StandardTimes.StandardWorkTimes = orgUnitStandardTimes;
                orgUnitsStandardTimesForOfficeID.Add(StandardTimes);
            }
            OrgUnitsNamesAndStandardTimes.OrgUnitStandardWorkTime = orgUnitsStandardTimesForOfficeID.ToArray();
            returnValue.Result = OrgUnitsNamesAndStandardTimes;
            //Put your code here
            return(returnValue);

            #endregion UserCode
        }