protected static FR_L5CO_GCOPwDfH_1421_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5CO_GCOPwDfH_1421 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L5CO_GCOPwDfH_1421_Array();
            var lsrResult   = new List <L5CO_GCOPwDfH_1421>();

            #region Get Customer Order Positions
            var resultHeaderWithPositions = cls_Get_CustomerOrderHeaders_with_Positions_by_HeaderIDs.Invoke(
                Connection,
                Transaction,
                new P_L3CO_GCOHwPbH_1604()
            {
                CustomerOrderHeaderIDs = new Guid[] { Parameter.OrderHeaderID }
            },
                securityTicket);
            if (resultHeaderWithPositions.Status != FR_Status.Success || resultHeaderWithPositions.Result == null || resultHeaderWithPositions.Result.Count() <= 0)
            {
                returnValue.Result = null;
                returnValue.Status = FR_Status.Error_Internal;
                return(returnValue);
            }
            var resultPositions = resultHeaderWithPositions.Result.Single().Positions;
            #endregion

            #region Get Articles
            var paramArticles = new CL3_Articles.Atomic.Retrieval.P_L3AR_GAfAL_0942();
            paramArticles.ProductID_List = resultPositions.Select(x => x.CMN_PRO_Product_RefID).ToArray <Guid>();

            var articles = new CL3_Articles.Atomic.Retrieval.L3AR_GAfAL_0942[0];

            if (paramArticles.ProductID_List.Length != 0)
            {
                articles = CL3_Articles.Atomic.Retrieval.cls_Get_Articles_for_ArticleList.Invoke(Connection, Transaction, paramArticles, securityTicket).Result;
            }

            #endregion

            foreach (var position in resultPositions)
            {
                var article = articles.SingleOrDefault(x => x.CMN_PRO_ProductID == position.CMN_PRO_Product_RefID);
                if (article == null)
                {
                    continue;
                }

                lsrResult.Add(new L5CO_GCOPwDfH_1421()
                {
                    OrderPosition = position,
                    Article       = article
                });
            }


            returnValue.Result = lsrResult.ToArray();
            return(returnValue);

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

            FR_L5CO_GCOPwDfH_1421_Array functionReturn = new FR_L5CO_GCOPwDfH_1421_Array();

            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_CustomerOrderPositions_with_Details_for_HeaderID", ex);
            }
            return(functionReturn);
        }