protected static FR_L3AS_GSMRfPL_1508_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3AS_GSMRfPL_1508 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L3AS_GSMRfPL_1508_Array();
            //Put your code here

            const double defaultConsideredDays = 90;

            #region GetConsideredDays

            var consDaysParam = new P_L2AS_GTASfSK_1313()
            {
                TenantApplicationSettingsKey = EnumUtils.GetEnumDescription(EApplicationSettings.MonthlySalesTimeSpan)
            };

            var tenantAppSettings = cls_Get_Tenant_Application_Settings_for_SettingsKey.Invoke(Connection, Transaction, consDaysParam, securityTicket).Result;


            var consideredDays = defaultConsideredDays;

            if (tenantAppSettings != null)
            {
                double.TryParse(tenantAppSettings.DefaultValue, out consideredDays);
                double.TryParse(tenantAppSettings.ItemValue, out consideredDays);
            }

            #endregion

            var dailysalesOverall = new List <L3AS_GDOfPLaTP_1021>();
            if (Parameter.ProductIDList != null && Parameter.ProductIDList.Count() > 0)
            {
                P_L3AS_GDOfPLaTP_1021 param = new P_L3AS_GDOfPLaTP_1021();
                param.ProductIDList = Parameter.ProductIDList;
                param.DateFrom      = DateTime.Now.AddDays(-consideredDays);
                param.DateTo        = DateTime.Now;

                dailysalesOverall = cls_Get_DailysalesOverall_for_ProductList_and_TimePeriod.Invoke(Connection, Transaction, param, securityTicket).Result.ToList();
            }

            List <L3AS_GSMRfPL_1508> retVal = new List <L3AS_GSMRfPL_1508>();

            foreach (var item in dailysalesOverall)
            {
                L3AS_GSMRfPL_1508 retItem = new L3AS_GSMRfPL_1508();
                retItem.MSR       = Math.Round((item.OverallSoldQuantity / consideredDays) * 30, 1);
                retItem.ProductID = item.Product_RefID;
                retVal.Add(retItem);
            }


            returnValue.Result = retVal.ToArray();


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

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