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

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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_OphthalShipments.Atomic.Retrieval.SQL.cls_Get_ShippmentPositionsForDoctorID_and_DateRange.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, "HEC_DoctorID", Parameter.HEC_DoctorID);

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

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



            List <L5OS_GSPfDaDR_0402_raw> results = new List <L5OS_GSPfDaDR_0402_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[] { "HEC_ShippingPosition_BarcodeLabelID", "CMN_PRO_ProductID", "LOG_SHP_Shipment_PositionID", "LOG_SHP_Shipment_HeaderID", "CMN_QST_Questionnaire_SubmissionID", "HEC_ShippingPosition_QuestionnaireSubmissionID", "ShippingPosition_BarcodeLabel", "Product_Number", "Header_Creation_Timestamp", "R_IsSubmission_Complete", "Header_IsShipped", "Product_Name_DictID", "Product_Description_DictID", "CMN_QST_Questionnaire_SubmissionItemID", "CMN_QST_QuestionItem_EnumerationAnswerID", "CMN_QST_Questionnaire_ItemID", "QuestionItem_SequenceNumber", "QuestionItem_Label_DictID", "EnumerationAnswer_Text_DictID" });
                while (reader.Read())
                {
                    L5OS_GSPfDaDR_0402_raw resultItem = new L5OS_GSPfDaDR_0402_raw();
                    //0:Parameter HEC_ShippingPosition_BarcodeLabelID of type Guid
                    resultItem.HEC_ShippingPosition_BarcodeLabelID = reader.GetGuid(0);
                    //1:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(1);
                    //2:Parameter LOG_SHP_Shipment_PositionID of type Guid
                    resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(2);
                    //3:Parameter LOG_SHP_Shipment_HeaderID of type Guid
                    resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(3);
                    //4:Parameter CMN_QST_Questionnaire_SubmissionID of type Guid
                    resultItem.CMN_QST_Questionnaire_SubmissionID = reader.GetGuid(4);
                    //5:Parameter HEC_ShippingPosition_QuestionnaireSubmissionID of type Guid
                    resultItem.HEC_ShippingPosition_QuestionnaireSubmissionID = reader.GetGuid(5);
                    //6:Parameter ShippingPosition_BarcodeLabel of type String
                    resultItem.ShippingPosition_BarcodeLabel = reader.GetString(6);
                    //7:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(7);
                    //8:Parameter Header_Creation_Timestamp of type DateTime
                    resultItem.Header_Creation_Timestamp = reader.GetDate(8);
                    //9:Parameter R_IsSubmission_Complete of type bool
                    resultItem.R_IsSubmission_Complete = reader.GetBoolean(9);
                    //10:Parameter Header_IsShipped of type bool
                    resultItem.Header_IsShipped = reader.GetBoolean(10);
                    //11:Parameter Product_Name_DictID of type Dict
                    resultItem.Product_Name_DictID             = reader.GetDictionary(11);
                    resultItem.Product_Name_DictID.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name_DictID);
                    //12:Parameter Product_Description_DictID of type Dict
                    resultItem.Product_Description_DictID             = reader.GetDictionary(12);
                    resultItem.Product_Description_DictID.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Description_DictID);
                    //13:Parameter CMN_QST_Questionnaire_SubmissionItemID of type Guid
                    resultItem.CMN_QST_Questionnaire_SubmissionItemID = reader.GetGuid(13);
                    //14:Parameter CMN_QST_QuestionItem_EnumerationAnswerID of type Guid
                    resultItem.CMN_QST_QuestionItem_EnumerationAnswerID = reader.GetGuid(14);
                    //15:Parameter CMN_QST_Questionnaire_ItemID of type Guid
                    resultItem.CMN_QST_Questionnaire_ItemID = reader.GetGuid(15);
                    //16:Parameter QuestionItem_SequenceNumber of type int
                    resultItem.QuestionItem_SequenceNumber = reader.GetInteger(16);
                    //17:Parameter QuestionItem_Label of type Dict
                    resultItem.QuestionItem_Label             = reader.GetDictionary(17);
                    resultItem.QuestionItem_Label.SourceTable = "cmn_qst_questionnaire_questionitems";
                    loader.Append(resultItem.QuestionItem_Label);
                    //18:Parameter EnumerationAnswer_Text_DictID of type Dict
                    resultItem.EnumerationAnswer_Text_DictID             = reader.GetDictionary(18);
                    resultItem.EnumerationAnswer_Text_DictID.SourceTable = "cmn_qst_questionitem_enumerationanswers";
                    loader.Append(resultItem.EnumerationAnswer_Text_DictID);

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

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