Exemple #1
0
        private void LoadData()
        {

            this.NameField.Text = ShippingMethod.Name;
            if (this.NameField.Text == string.Empty)
            {
                this.NameField.Text = "Rate Per Weight Formula";
            }

            RatePerWeightFormulaSettings Settings = new RatePerWeightFormulaSettings();
            Settings.Merge(ShippingMethod.Settings);
            if (Settings.BaseAmount < 0) Settings.BaseAmount = 0;
            if (Settings.BaseWeight < 0) Settings.BaseWeight = 0;
            if (Settings.MinWeight < 0) Settings.MinWeight = 0;
            if (Settings.MaxWeight < 0) Settings.MaxWeight = 9999;
            if (Settings.AdditionalWeightCharge < 0) Settings.AdditionalWeightCharge = 0;


            this.BaseAmountField.Text = Settings.BaseAmount.ToString("C");
            this.AdditionalWeightChargeField.Text = Settings.AdditionalWeightCharge.ToString("C");
            this.BaseWeightField.Text = Settings.BaseWeight.ToString();
            this.MinWeightField.Text = Settings.MinWeight.ToString();
            this.MaxWeightField.Text = Settings.MaxWeight.ToString();

            

            // ZONES
            if (this.lstZones.Items.FindByValue(ShippingMethod.ZoneId.ToString()) != null)
            {
                this.lstZones.ClearSelection();
                this.lstZones.Items.FindByValue(ShippingMethod.ZoneId.ToString()).Selected = true;
            }

            // Select Hightlights
            string highlight = Settings.GetSettingOrEmpty("highlight");
            if (this.lstHighlights.Items.FindByText(highlight) != null)
            {
                this.lstHighlights.ClearSelection();
                this.lstHighlights.Items.FindByText(highlight).Selected = true;
            }
        }