Ejemplo n.º 1
0
        protected void btnNew_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            RateTableLevel r = new RateTableLevel();
            r.Level = decimal.Parse(this.NewLevelField.Text);
            r.Rate = decimal.Parse(this.NewAmountField.Text);

            RateTableSettings settings = new RateTableSettings();
            settings.Merge(ShippingMethod.Settings);

            settings.AddLevel(r);

            ShippingMethod.Settings = settings;
            MyPage.MTApp.OrderServices.ShippingMethods.Update(ShippingMethod);
            LoadLevels();
        }
Ejemplo n.º 2
0
        private void LoadLevels()
        {
            RateTableSettings settings = new RateTableSettings();
            settings.Merge(ShippingMethod.Settings);

            List<RateTableLevel> levels = settings.GetLevels();
            this.GridView1.DataSource = levels;
            this.GridView1.DataBind();
        }
Ejemplo n.º 3
0
        private void RemoveLevel(string level, string rate)
        {
            RateTableSettings settings = new RateTableSettings();
            settings.Merge(ShippingMethod.Settings);

            RateTableLevel r = new RateTableLevel();
            r.Level = decimal.Parse(level);
            r.Rate = decimal.Parse(rate, System.Globalization.NumberStyles.Currency);

            settings.RemoveLevel(r);

            ShippingMethod.Settings = settings;
            MyPage.MTApp.OrderServices.ShippingMethods.Update(ShippingMethod);
            LoadLevels();
        }