Пример #1
0
        private void BindGrid()
        {
            var shippingRateComputationMethods = ShippingRateComputationMethodManager.GetAllShippingRateComputationMethods();

            gvShippingRateComputationMethods.DataSource = shippingRateComputationMethods;
            gvShippingRateComputationMethods.DataBind();
        }
Пример #2
0
        private void BindGrid()
        {
            ShippingRateComputationMethodCollection shippingRateComputationMethodCollection = ShippingRateComputationMethodManager.GetAllShippingRateComputationMethods();

            gvShippingRateComputationMethods.DataSource = shippingRateComputationMethodCollection;
            gvShippingRateComputationMethods.DataBind();
        }
Пример #3
0
        protected override void OnPreRender(EventArgs e)
        {
            StringBuilder warningResult = new StringBuilder();

            //currencies
            if (CurrencyManager.PrimaryExchangeRateCurrency == null)
            {
                warningResult.Append("Primary exchange rate currency is not set. <a href=\"Currencies.aspx\">Set now</a>");
                warningResult.Append("<br />");
                warningResult.Append("<br />");
            }
            if (CurrencyManager.PrimaryStoreCurrency == null)
            {
                warningResult.Append("Primary store currency is not set. <a href=\"Currencies.aspx\">Set now</a>");
                warningResult.Append("<br />");
                warningResult.Append("<br />");
            }

            //measures
            if (MeasureManager.BaseWeightIn == null)
            {
                warningResult.Append("The weight that will can used as a default is not set. <a href=\"GlobalSettings.aspx\">Set now</a>");
                warningResult.Append("<br />");
                warningResult.Append("<br />");
            }
            if (MeasureManager.BaseDimensionIn == null)
            {
                warningResult.Append("The dimension that will can used as a default is not set. <a href=\"GlobalSettings.aspx\">Set now</a>");
                warningResult.Append("<br />");
                warningResult.Append("<br />");
            }

            //languages
            LanguageCollection publishedLanguages = LanguageManager.GetAllLanguages(false);

            foreach (MessageTemplate messageTemplate in MessageManager.GetAllMessageTemplates())
            {
                foreach (Language language in publishedLanguages)
                {
                    LocalizedMessageTemplate localizedMessageTemplate = MessageManager.GetLocalizedMessageTemplate(messageTemplate.Name, language.LanguageId);
                    if (localizedMessageTemplate == null)
                    {
                        warningResult.AppendFormat("You don't have localized version of message template [{0}] for {1}. <a href=\"MessageTemplates.aspx\">Create it now</a>", messageTemplate.Name, language.Name);
                        warningResult.Append("<br />");
                        warningResult.Append("<br />");
                    }
                }
            }
            foreach (Topic topic in TopicManager.GetAllTopics())
            {
                foreach (Language language in publishedLanguages)
                {
                    LocalizedTopic localizedTopic = TopicManager.GetLocalizedTopic(topic.Name, language.LanguageId);
                    if (localizedTopic == null)
                    {
                        warningResult.AppendFormat("You don't have localized version of topic [{0}] for {1}. <a href=\"Topics.aspx\">Create it now</a>", topic.Name, language.Name);
                        warningResult.Append("<br />");
                        warningResult.Append("<br />");
                    }
                }
            }

            //shipping methods
            var srcmList         = ShippingRateComputationMethodManager.GetAllShippingRateComputationMethods(false);
            int offlineSrcmCount = 0;

            foreach (var srcm in srcmList)
            {
                if (srcm.ShippingRateComputationMethodType == ShippingRateComputationMethodTypeEnum.Offline)
                {
                    offlineSrcmCount++;
                }
            }
            if (offlineSrcmCount > 1)
            {
                warningResult.Append("Only one offline shipping rate computation method is recommended to use");
                warningResult.Append("<br />");
                warningResult.Append("<br />");
            }

            string warnings = warningResult.ToString();

            if (!String.IsNullOrEmpty(warnings))
            {
                lblWarnings.Text = warnings;
            }
            else
            {
                this.Visible = false;
            }

            base.OnPreRender(e);
        }