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

            FR_L5SR_GRaPHfRH_1636 functionReturn = new FR_L5SR_GRaPHfRH_1636();

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOLogistic_StockReceipt.Atomic.Retrieval.SQL.cls_Get_ReceiptHeader_and_ProcurmentHeader_for_ReceiptHeaderID.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;

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ReceiptHeaderID", Parameter.ReceiptHeaderID);



            List <L5SR_GRaPHfRH_1636> results = new List <L5SR_GRaPHfRH_1636>();
            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[] { "LOG_RCP_Receipt_HeaderID", "QualityControlPerformed_AtDate", "TakenIntoStock_AtDate", "ProcurementOrder_Number", "IsTakenIntoStock", "IsPriceConditionsManuallyCleared", "IsReceiptForwardedToBookkeeping", "IsQualityControlPerformed", "ReceiptNumber", "ProvidingSupplier_RefID", "PriceConditionsManuallyCleared_ByAccount_RefID", "PriceConditionsManuallyCleared_AtDate", "TakenIntoStock_ByAccount_RefID", "ReceiptForwardedToBookkeeping_ByAccount_RefID", "ReceiptForwardedToBookkeeping_AtDate", "QualityControlPerformed_ByAccount_RefID" });
                while (reader.Read())
                {
                    L5SR_GRaPHfRH_1636 resultItem = new L5SR_GRaPHfRH_1636();
                    //0:Parameter LOG_RCP_Receipt_HeaderID of type Guid
                    resultItem.LOG_RCP_Receipt_HeaderID = reader.GetGuid(0);
                    //1:Parameter QualityControlPerformed_AtDate of type DateTime
                    resultItem.QualityControlPerformed_AtDate = reader.GetDate(1);
                    //2:Parameter TakenIntoStock_AtDate of type DateTime
                    resultItem.TakenIntoStock_AtDate = reader.GetDate(2);
                    //3:Parameter ProcurementOrder_Number of type String
                    resultItem.ProcurementOrder_Number = reader.GetString(3);
                    //4:Parameter IsTakenIntoStock of type bool
                    resultItem.IsTakenIntoStock = reader.GetBoolean(4);
                    //5:Parameter IsPriceConditionsManuallyCleared of type bool
                    resultItem.IsPriceConditionsManuallyCleared = reader.GetBoolean(5);
                    //6:Parameter IsReceiptForwardedToBookkeeping of type bool
                    resultItem.IsReceiptForwardedToBookkeeping = reader.GetBoolean(6);
                    //7:Parameter IsQualityControlPerformed of type bool
                    resultItem.IsQualityControlPerformed = reader.GetBoolean(7);
                    //8:Parameter ReceiptNumber of type String
                    resultItem.ReceiptNumber = reader.GetString(8);
                    //9:Parameter ProvidingSupplier_RefID of type Guid
                    resultItem.ProvidingSupplier_RefID = reader.GetGuid(9);
                    //10:Parameter PriceConditionsManuallyCleared_ByAccount_RefID of type Guid
                    resultItem.PriceConditionsManuallyCleared_ByAccount_RefID = reader.GetGuid(10);
                    //11:Parameter PriceConditionsManuallyCleared_AtDate of type DateTime
                    resultItem.PriceConditionsManuallyCleared_AtDate = reader.GetDate(11);
                    //12:Parameter TakenIntoStock_ByAccount_RefID of type Guid
                    resultItem.TakenIntoStock_ByAccount_RefID = reader.GetGuid(12);
                    //13:Parameter ReceiptForwardedToBookkeeping_ByAccount_RefID of type Guid
                    resultItem.ReceiptForwardedToBookkeeping_ByAccount_RefID = reader.GetGuid(13);
                    //14:Parameter ReceiptForwardedToBookkeeping_AtDate of type DateTime
                    resultItem.ReceiptForwardedToBookkeeping_AtDate = reader.GetDate(14);
                    //15:Parameter QualityControlPerformed_ByAccount_RefID of type Guid
                    resultItem.QualityControlPerformed_ByAccount_RefID = reader.GetGuid(15);

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }