protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5WH_SGQL_1335 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Bool();
            //Put your code here

            returnValue.Result = false;
            ORM_LOG_WRH_QuantityLevel quantityLevel = null;

            if (Parameter.LOG_WRH_QuantityLevelID != Guid.Empty)
            {
                quantityLevel = ORM_LOG_WRH_QuantityLevel.Query.Search(Connection, Transaction, new ORM_LOG_WRH_QuantityLevel.Query
                {
                    IsDeleted = false,
                    LOG_WRH_QuantityLevelID = Parameter.LOG_WRH_QuantityLevelID,
                    Tenant_RefID            = securityTicket.TenantID
                }).SingleOrDefault();
            }

            if (quantityLevel != null)
            {
                quantityLevel.Quantity_Minimum = Parameter.Quantity_Minimum;
                quantityLevel.Save(Connection, Transaction);
            }
            else
            {
                quantityLevel = new ORM_LOG_WRH_QuantityLevel();
                quantityLevel.LOG_WRH_QuantityLevelID = Guid.NewGuid();
                quantityLevel.Tenant_RefID            = securityTicket.TenantID;
                quantityLevel.Quantity_Minimum        = Parameter.Quantity_Minimum;
                quantityLevel.Save(Connection, Transaction);
            }

            var currentWareHouse = ORM_LOG_WRH_Warehouse.Query.Search(Connection, Transaction, new ORM_LOG_WRH_Warehouse.Query
            {
                IsDeleted           = false,
                LOG_WRH_WarehouseID = Parameter.LOG_WRH_WarehouseID,
                Tenant_RefID        = securityTicket.TenantID
            }).SingleOrDefault();


            ORM_LOG_WRH_Warehouse_2_QuantityLevel WareHouseToQuantityLevels = null;

            if (Parameter.AssignmentID != Guid.Empty)
            {
                WareHouseToQuantityLevels = ORM_LOG_WRH_Warehouse_2_QuantityLevel.Query.Search(Connection, Transaction, new ORM_LOG_WRH_Warehouse_2_QuantityLevel.Query
                {
                    AssignmentID = Parameter.AssignmentID
                }).Single();
            }

            if (WareHouseToQuantityLevels == null || Parameter.AssignmentID == Guid.Empty)
            {
                WareHouseToQuantityLevels = new ORM_LOG_WRH_Warehouse_2_QuantityLevel();
                WareHouseToQuantityLevels.AssignmentID = Guid.NewGuid();
                WareHouseToQuantityLevels.LOG_WRH_QuantityLevel_RefID = quantityLevel.LOG_WRH_QuantityLevelID;
                WareHouseToQuantityLevels.LOG_WRH_Warehouse_RefID     = currentWareHouse.LOG_WRH_WarehouseID;
                WareHouseToQuantityLevels.Tenant_RefID = securityTicket.TenantID;
                WareHouseToQuantityLevels.Save(Connection, Transaction);
            }


            returnValue.Result = true;

            return(returnValue);

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

            FR_Bool functionReturn = new FR_Bool();

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