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

            FR_L5CO_GCOHwPnCI_0820_Array functionReturn = new FR_L5CO_GCOHwPnCI_0820_Array();

            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_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions", ex);
            }
            return(functionReturn);
        }
        protected static FR_L5CO_GCOHwPnCI_0820_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5CO_GCOHwPnCI_0820_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOBackoffice_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            List <L5CO_GCOHwPnCI_0820_raw> results = new List <L5CO_GCOHwPnCI_0820_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "ORD_CUO_CustomerOrder_HeaderID", "IfCompany_CMN_COM_CompanyInfo_RefID", "CustomerOrder_Number", "OrderedByCompanyName", "OrderedByEmail", "CustomerOrder_Date", "TotalValue_BeforeTax", "Status_Code", "Status_Name_DictID", "GlobalPropertyMatchingID", "OrderCreatedBy", "IsCustomerOrderFinalized", "ConfirmedBy_DisplayName", "Product_Name_DictID", "Product_Number", "CustomerOrder_Header_RefID", "PackageContent_Amount", "PackageContent_MeasuredInUnit_RefID", "DosageForm_Name_DictID", "Abbreviation_DictID", "Label_DictID", "ORD_CUO_CustomerOrder_PositionID", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "TaxRate", "TaxName_DictID", "EconomicRegion_RefID", "ApplicableSalesTax_RefID" });
                while (reader.Read())
                {
                    L5CO_GCOHwPnCI_0820_raw resultItem = new L5CO_GCOHwPnCI_0820_raw();
                    //0:Parameter ORD_CUO_CustomerOrder_HeaderID of type Guid
                    resultItem.ORD_CUO_CustomerOrder_HeaderID = reader.GetGuid(0);
                    //1:Parameter IfCompany_CMN_COM_CompanyInfo_RefID of type Guid
                    resultItem.IfCompany_CMN_COM_CompanyInfo_RefID = reader.GetGuid(1);
                    //2:Parameter CustomerOrder_Number of type String
                    resultItem.CustomerOrder_Number = reader.GetString(2);
                    //3:Parameter OrderedByCompanyName of type String
                    resultItem.OrderedByCompanyName = reader.GetString(3);
                    //4:Parameter OrderedByEmail of type String
                    resultItem.OrderedByEmail = reader.GetString(4);
                    //5:Parameter CustomerOrder_Date of type DateTime
                    resultItem.CustomerOrder_Date = reader.GetDate(5);
                    //6:Parameter TotalValue_BeforeTax of type Decimal
                    resultItem.TotalValue_BeforeTax = reader.GetDecimal(6);
                    //7:Parameter Status_Code of type String
                    resultItem.Status_Code = reader.GetString(7);
                    //8:Parameter Status_Name of type Dict
                    resultItem.Status_Name             = reader.GetDictionary(8);
                    resultItem.Status_Name.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name);
                    //9:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(9);
                    //10:Parameter OrderCreatedBy of type String
                    resultItem.OrderCreatedBy = reader.GetString(10);
                    //11:Parameter IsCustomerOrderFinalized of type Boolean
                    resultItem.IsCustomerOrderFinalized = reader.GetBoolean(11);
                    //12:Parameter ConfirmedBy_DisplayName of type String
                    resultItem.ConfirmedBy_DisplayName = reader.GetString(12);
                    //13:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(13);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //14:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(14);
                    //15:Parameter CustomerOrder_Header_RefID of type Guid
                    resultItem.CustomerOrder_Header_RefID = reader.GetGuid(15);
                    //16:Parameter PackageContent_Amount of type String
                    resultItem.PackageContent_Amount = reader.GetString(16);
                    //17:Parameter PackageContent_MeasuredInUnit_RefID of type Guid
                    resultItem.PackageContent_MeasuredInUnit_RefID = reader.GetGuid(17);
                    //18:Parameter DosageForm_Name of type Dict
                    resultItem.DosageForm_Name             = reader.GetDictionary(18);
                    resultItem.DosageForm_Name.SourceTable = "hec_product_dosageforms";
                    loader.Append(resultItem.DosageForm_Name);
                    //19:Parameter Abbreviation of type Dict
                    resultItem.Abbreviation             = reader.GetDictionary(19);
                    resultItem.Abbreviation.SourceTable = "cmn_units";
                    loader.Append(resultItem.Abbreviation);
                    //20:Parameter Label of type Dict
                    resultItem.Label             = reader.GetDictionary(20);
                    resultItem.Label.SourceTable = "cmn_units";
                    loader.Append(resultItem.Label);
                    //21:Parameter ORD_CUO_CustomerOrder_PositionID of type Guid
                    resultItem.ORD_CUO_CustomerOrder_PositionID = reader.GetGuid(21);
                    //22:Parameter Position_Quantity of type double
                    resultItem.Position_Quantity = reader.GetDouble(22);
                    //23:Parameter Position_ValuePerUnit of type Decimal
                    resultItem.Position_ValuePerUnit = reader.GetDecimal(23);
                    //24:Parameter Position_ValueTotal of type Decimal
                    resultItem.Position_ValueTotal = reader.GetDecimal(24);
                    //25:Parameter TaxRate of type double
                    resultItem.TaxRate = reader.GetDouble(25);
                    //26:Parameter TaxName_DictID of type Dict
                    resultItem.TaxName_DictID             = reader.GetDictionary(26);
                    resultItem.TaxName_DictID.SourceTable = "acc_tax_taxes";
                    loader.Append(resultItem.TaxName_DictID);
                    //27:Parameter EconomicRegion_RefID of type Guid
                    resultItem.EconomicRegion_RefID = reader.GetGuid(27);
                    //28:Parameter ApplicableSalesTax_RefID of type Guid
                    resultItem.ApplicableSalesTax_RefID = reader.GetGuid(28);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_CustomerOrderHeaders_with_Positions_notRelatedTo_CustomerInteractions", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L5CO_GCOHwPnCI_0820_raw.Convert(results).ToArray();
            return(returnStatus);
        }