protected static FR_L5DD_GSFS_1538_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DD_GSFS_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5DD_GSFS_1538_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_KPRS_DueDiligences.Atomic.Retrieval.SQL.cls_get_Submission_For_SubmissioniD.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, "RevisionID", Parameter.RevisionID);



            List <L5DD_GSFS_1538> results = new List <L5DD_GSFS_1538>();
            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[] { "RES_DUD_RevisionID", "RevisionGroup_RefID", "RES_BLD_Building_RefID", "Revision_Comment", "Revision_Title", "ScopeOfInspectionIncludes_Internal", "ScopeOfInspectionIncludes_External", "QuestionnaireVersion_RefID", "RES_BLD_BuildingID", "Building_BalconyPortionPercent", "Building_Name", "Building_DocumentationStructure_RefID", "Creation_Timestamp", "IsContaminationSuspected", "Building_NumberOfFloors", "Building_ElevatorCoveragePercent", "Building_NumberOfAppartments", "Building_NumberOfOccupiedAppartments", "Building_NumberOfOffices", "Building_NumberOfRetailUnits", "Building_NumberOfProductionUnits", "Building_NumberOfOtherUnits", "Building_CurrentAverageRentPrice_per_sqm_RefID", "BuildingRevisionHeader_RefID" });
                while (reader.Read())
                {
                    L5DD_GSFS_1538 resultItem = new L5DD_GSFS_1538();
                    //0:Parameter RES_DUD_RevisionID of type Guid
                    resultItem.RES_DUD_RevisionID = reader.GetGuid(0);
                    //1:Parameter RevisionGroup_RefID of type Guid
                    resultItem.RevisionGroup_RefID = reader.GetGuid(1);
                    //2:Parameter RES_BLD_Building_RefID of type Guid
                    resultItem.RES_BLD_Building_RefID = reader.GetGuid(2);
                    //3:Parameter Revision_Comment of type String
                    resultItem.Revision_Comment = reader.GetString(3);
                    //4:Parameter Revision_Title of type String
                    resultItem.Revision_Title = reader.GetString(4);
                    //5:Parameter ScopeOfInspectionIncludes_Internal of type String
                    resultItem.ScopeOfInspectionIncludes_Internal = reader.GetString(5);
                    //6:Parameter ScopeOfInspectionIncludes_External of type String
                    resultItem.ScopeOfInspectionIncludes_External = reader.GetString(6);
                    //7:Parameter QuestionnaireVersion_RefID of type Guid
                    resultItem.QuestionnaireVersion_RefID = reader.GetGuid(7);
                    //8:Parameter RES_BLD_BuildingID of type Guid
                    resultItem.RES_BLD_BuildingID = reader.GetGuid(8);
                    //9:Parameter Building_BalconyPortionPercent of type String
                    resultItem.Building_BalconyPortionPercent = reader.GetString(9);
                    //10:Parameter Building_Name of type String
                    resultItem.Building_Name = reader.GetString(10);
                    //11:Parameter Building_DocumentationStructure_RefID of type Guid
                    resultItem.Building_DocumentationStructure_RefID = reader.GetGuid(11);
                    //12:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(12);
                    //13:Parameter IsContaminationSuspected of type bool
                    resultItem.IsContaminationSuspected = reader.GetBoolean(13);
                    //14:Parameter Building_NumberOfFloors of type String
                    resultItem.Building_NumberOfFloors = reader.GetString(14);
                    //15:Parameter Building_ElevatorCoveragePercent of type String
                    resultItem.Building_ElevatorCoveragePercent = reader.GetString(15);
                    //16:Parameter Building_NumberOfAppartments of type String
                    resultItem.Building_NumberOfAppartments = reader.GetString(16);
                    //17:Parameter Building_NumberOfOccupiedAppartments of type String
                    resultItem.Building_NumberOfOccupiedAppartments = reader.GetString(17);
                    //18:Parameter Building_NumberOfOffices of type String
                    resultItem.Building_NumberOfOffices = reader.GetString(18);
                    //19:Parameter Building_NumberOfRetailUnits of type String
                    resultItem.Building_NumberOfRetailUnits = reader.GetString(19);
                    //20:Parameter Building_NumberOfProductionUnits of type String
                    resultItem.Building_NumberOfProductionUnits = reader.GetString(20);
                    //21:Parameter Building_NumberOfOtherUnits of type String
                    resultItem.Building_NumberOfOtherUnits = reader.GetString(21);
                    //22:Parameter Building_CurrentAverageRentPrice_per_sqm_RefID of type Guid
                    resultItem.Building_CurrentAverageRentPrice_per_sqm_RefID = reader.GetGuid(22);
                    //23:Parameter BuildingRevisionHeader_RefID of type Guid
                    resultItem.BuildingRevisionHeader_RefID = reader.GetGuid(23);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5DD_GSFS_1538_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5DD_GSFS_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5DD_GSFS_1538_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DD_GSFS_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5DD_GSFS_1538_Array functionReturn = new FR_L5DD_GSFS_1538_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_Submission_For_SubmissioniD", ex);
            }
            return(functionReturn);
        }
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5DD_GSFS_1538_Array Invoke(string ConnectionString, P_L5DD_GSFS_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }