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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_MyHealthClub_OrgUnits.Atomic.Retrieval.SQL.cls_Get_OrgUnitData_Edit_for_UnitID.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, "OfficeID", Parameter.OfficeID);



            List <L5OU_GOUDEUID_1502_raw> results = new List <L5OU_GOUDEUID_1502_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[] { "CMN_STR_OfficeID", "Parent_RefID", "DisplayImage_Document_RefID", "Office_Name_DictID", "PhoneNumber", "Default_Email", "Default_Website", "Comment", "ContactPersonFirstName", "ContactPersonLastName", "ContactPersonTitle", "ParentNameDict", "CMN_AddressID", "IsDefaultAddress", "IsSpecialAddress", "IsBillingAddress", "IsShippingAddress", "Street_Name", "Street_Number", "City_Name", "ZIP", "Longitude", "Lattitude", "Country_ISOCode", "Country_Name", "PPS_TSK_Task_Template_RefID", "HEC_MedicalPractice_TypeID", "MedicalPracticeType_Name_DictID", "CMN_LanguageID", "IsDeleted", "Name_DictID" });
                while (reader.Read())
                {
                    L5OU_GOUDEUID_1502_raw resultItem = new L5OU_GOUDEUID_1502_raw();
                    //0:Parameter CMN_STR_OfficeID of type Guid
                    resultItem.CMN_STR_OfficeID = reader.GetGuid(0);
                    //1:Parameter Parent_RefID of type Guid
                    resultItem.Parent_RefID = reader.GetGuid(1);
                    //2:Parameter DisplayImage_Document_RefID of type Guid
                    resultItem.DisplayImage_Document_RefID = reader.GetGuid(2);
                    //3:Parameter Office_Name of type Dict
                    resultItem.Office_Name             = reader.GetDictionary(3);
                    resultItem.Office_Name.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.Office_Name);
                    //4:Parameter PhoneNumber of type String
                    resultItem.PhoneNumber = reader.GetString(4);
                    //5:Parameter Default_Email of type String
                    resultItem.Default_Email = reader.GetString(5);
                    //6:Parameter Default_Website of type String
                    resultItem.Default_Website = reader.GetString(6);
                    //7:Parameter Comment of type String
                    resultItem.Comment = reader.GetString(7);
                    //8:Parameter ContactPersonFirstName of type String
                    resultItem.ContactPersonFirstName = reader.GetString(8);
                    //9:Parameter ContactPersonLastName of type String
                    resultItem.ContactPersonLastName = reader.GetString(9);
                    //10:Parameter ContactPersonTitle of type String
                    resultItem.ContactPersonTitle = reader.GetString(10);
                    //11:Parameter ParentNameDict of type Dict
                    resultItem.ParentNameDict             = reader.GetDictionary(11);
                    resultItem.ParentNameDict.SourceTable = "cmn_str_offices";
                    loader.Append(resultItem.ParentNameDict);
                    //12:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(12);
                    //13:Parameter IsDefaultAddress of type bool
                    resultItem.IsDefaultAddress = reader.GetBoolean(13);
                    //14:Parameter IsSpecialAddress of type bool
                    resultItem.IsSpecialAddress = reader.GetBoolean(14);
                    //15:Parameter IsBillingAddress of type bool
                    resultItem.IsBillingAddress = reader.GetBoolean(15);
                    //16:Parameter IsShippingAddress of type bool
                    resultItem.IsShippingAddress = reader.GetBoolean(16);
                    //17:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(17);
                    //18:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(18);
                    //19:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(19);
                    //20:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(20);
                    //21:Parameter Longitude of type double
                    resultItem.Longitude = reader.GetDouble(21);
                    //22:Parameter Lattitude of type double
                    resultItem.Lattitude = reader.GetDouble(22);
                    //23:Parameter Country_ISOCode of type String
                    resultItem.Country_ISOCode = reader.GetString(23);
                    //24:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(24);
                    //25:Parameter PPS_TSK_Task_Template_RefID of type Guid
                    resultItem.PPS_TSK_Task_Template_RefID = reader.GetGuid(25);
                    //26:Parameter HEC_MedicalPractice_TypeID of type Guid
                    resultItem.HEC_MedicalPractice_TypeID = reader.GetGuid(26);
                    //27:Parameter Medical_Practice_Type_Name of type Dict
                    resultItem.Medical_Practice_Type_Name             = reader.GetDictionary(27);
                    resultItem.Medical_Practice_Type_Name.SourceTable = "hec_medicalpractice_types";
                    loader.Append(resultItem.Medical_Practice_Type_Name);
                    //28:Parameter CMN_LanguageID of type Guid
                    resultItem.CMN_LanguageID = reader.GetGuid(28);
                    //29:Parameter IsDeleted of type bool
                    resultItem.IsDeleted = reader.GetBoolean(29);
                    //30:Parameter Name of type Dict
                    resultItem.Name             = reader.GetDictionary(30);
                    resultItem.Name.SourceTable = "cmn_languages";
                    loader.Append(resultItem.Name);

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

            returnStatus.Result = L5OU_GOUDEUID_1502_raw.Convert(results).FirstOrDefault();

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

            FR_L5OU_GOUDEUID_1502 functionReturn = new FR_L5OU_GOUDEUID_1502();

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