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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_KPRS_DueDiligences.Atomic.Retrieval.SQL.cls_Get_ApartmentSubmisionInfo_For_RevisionID.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);
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "BuildingPartID", Parameter.BuildingPartID);

            if (Parameter.BuildingPartID_IsSpecified == false)
            {
                var regex = new System.Text.RegularExpressions.Regex(@"((and|or)\s*)?(\w*\.)?\w*\s*(=|like|<|>)\s*@BuildingPartID", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                command.CommandText = regex.Replace(command.CommandText, "");
            }

            List <L5DD_GASIfRID_1007_raw> results = new List <L5DD_GASIfRID_1007_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[] { "RES_STR_ApartmentID", "RES_BLD_Apartment_RefID", "AverageRating_RefID", "Apartment_DocumentHeader_RefID", "Apartment_Comment", "IsAppartment_ForRent", "ApartmentSize_Unit_RefID", "ApartmentSize_Value", "TypeOfHeating_RefID", "TypeOfFlooring_RefID", "TypeOfWallCovering_RefID", "RES_STR_Apartment_PropertyAssessmentID", "Rating_RefID", "DocumentHeader_RefID", "GlobalPropertyMatchingID", "RES_STR_Apartment_PropertyID", "PropertyAssessment_Comment", "RES_STR_Apartment_RequiredActionID", "SelectedActionVersion_RefID", "RequiredAction_Comment", "Action_PricePerUnit_RefID", "Action_Unit_RefID", "Action_UnitAmount", "IsCustom", "IfCustom_Name", "IfCustom_Description", "EffectivePrice_RefID", "Action_Timeframe_RefID", "Action_Name_DictID", "PriceValue_Amount" });
                while (reader.Read())
                {
                    L5DD_GASIfRID_1007_raw resultItem = new L5DD_GASIfRID_1007_raw();
                    //0:Parameter RES_STR_ApartmentID of type Guid
                    resultItem.RES_STR_ApartmentID = reader.GetGuid(0);
                    //1:Parameter RES_BLD_Apartment_RefID of type Guid
                    resultItem.RES_BLD_Apartment_RefID = reader.GetGuid(1);
                    //2:Parameter AverageRating_RefID of type Guid
                    resultItem.AverageRating_RefID = reader.GetGuid(2);
                    //3:Parameter Apartment_DocumentHeader_RefID of type Guid
                    resultItem.Apartment_DocumentHeader_RefID = reader.GetGuid(3);
                    //4:Parameter Apartment_Comment of type String
                    resultItem.Apartment_Comment = reader.GetString(4);
                    //5:Parameter IsAppartment_ForRent of type bool
                    resultItem.IsAppartment_ForRent = reader.GetBoolean(5);
                    //6:Parameter ApartmentSize_Unit_RefID of type Guid
                    resultItem.ApartmentSize_Unit_RefID = reader.GetGuid(6);
                    //7:Parameter ApartmentSize_Value of type double
                    resultItem.ApartmentSize_Value = reader.GetDouble(7);
                    //8:Parameter TypeOfHeating_RefID of type Guid
                    resultItem.TypeOfHeating_RefID = reader.GetGuid(8);
                    //9:Parameter TypeOfFlooring_RefID of type Guid
                    resultItem.TypeOfFlooring_RefID = reader.GetGuid(9);
                    //10:Parameter TypeOfWallCovering_RefID of type Guid
                    resultItem.TypeOfWallCovering_RefID = reader.GetGuid(10);
                    //11:Parameter RES_STR_Apartment_PropertyAssessmentID of type Guid
                    resultItem.RES_STR_Apartment_PropertyAssessmentID = reader.GetGuid(11);
                    //12:Parameter Rating_RefID of type Guid
                    resultItem.Rating_RefID = reader.GetGuid(12);
                    //13:Parameter DocumentHeader_RefID of type Guid
                    resultItem.DocumentHeader_RefID = reader.GetGuid(13);
                    //14:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(14);
                    //15:Parameter RES_STR_Apartment_PropertyID of type Guid
                    resultItem.RES_STR_Apartment_PropertyID = reader.GetGuid(15);
                    //16:Parameter PropertyAssessment_Comment of type String
                    resultItem.PropertyAssessment_Comment = reader.GetString(16);
                    //17:Parameter RES_STR_Apartment_RequiredActionID of type Guid
                    resultItem.RES_STR_Apartment_RequiredActionID = reader.GetGuid(17);
                    //18:Parameter SelectedActionVersion_RefID of type Guid
                    resultItem.SelectedActionVersion_RefID = reader.GetGuid(18);
                    //19:Parameter RequiredAction_Comment of type String
                    resultItem.RequiredAction_Comment = reader.GetString(19);
                    //20:Parameter Action_PricePerUnit_RefID of type Guid
                    resultItem.Action_PricePerUnit_RefID = reader.GetGuid(20);
                    //21:Parameter Action_Unit_RefID of type Guid
                    resultItem.Action_Unit_RefID = reader.GetGuid(21);
                    //22:Parameter Action_UnitAmount of type double
                    resultItem.Action_UnitAmount = reader.GetDouble(22);
                    //23:Parameter IsCustom of type bool
                    resultItem.IsCustom = reader.GetBoolean(23);
                    //24:Parameter IfCustom_Name of type String
                    resultItem.IfCustom_Name = reader.GetString(24);
                    //25:Parameter IfCustom_Description of type String
                    resultItem.IfCustom_Description = reader.GetString(25);
                    //26:Parameter EffectivePrice_RefID of type Guid
                    resultItem.EffectivePrice_RefID = reader.GetGuid(26);
                    //27:Parameter Action_Timeframe_RefID of type Guid
                    resultItem.Action_Timeframe_RefID = reader.GetGuid(27);
                    //28:Parameter Action_Name of type Dict
                    resultItem.Action_Name             = reader.GetDictionary(28);
                    resultItem.Action_Name.SourceTable = "res_act_action_version";
                    loader.Append(resultItem.Action_Name);
                    //29:Parameter PriceValue_Amount of type double
                    resultItem.PriceValue_Amount = reader.GetDouble(29);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw ex;
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L5DD_GASIfRID_1007_raw.Convert(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_GASIfRID_1007_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5DD_GASIfRID_1007 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5DD_GASIfRID_1007_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DD_GASIfRID_1007 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

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