예제 #1
0
        /// <summary>
        /// Adds the rate table shipping method.
        /// </summary>
        //[TestMethod]
        //[Priority(19)]
        public void AddSM_RateTable()
        {
            #region Arrange
            var smethod0     = new ShippingMethod();
            var setting      = _irepo.GetAddSMInfo_RateTable(ref smethod0);
            var spproviderid = GetShippingProviderId(smethod0.ShippingProviderId);
            var lstlevel     = setting.GetLevels();

            var smethod1 = new ShippingMethod
            {
                Name               = smethod0.Name,
                StoreId            = _application.CurrentStore.Id,
                ZoneId             = smethod0.ZoneId,
                AdjustmentType     = ShippingMethodAdjustmentType.Amount,
                Adjustment         = 0,
                ShippingProviderId = spproviderid,
            };

            var settings = new RateTableSettings();
            settings.Merge(smethod1.Settings);
            foreach (var rateTableLevel in lstlevel)
            {
                settings.AddLevel(rateTableLevel);
            }

            smethod1.Settings.Merge(settings);
            #endregion

            //Act/Assert
            Assert.IsTrue(_application.OrderServices.ShippingMethods.Create(smethod1));
        }
예제 #2
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();
        }
예제 #3
0
        protected void btnNew_Click(object sender, EventArgs e)
        {
            var r = new RateTableLevel
            {
                Level = decimal.Parse(NewLevelField.Text),
                Rate  = decimal.Parse(NewAmountField.Text)
            };

            var settings = new RateTableSettings();

            settings.Merge(ShippingMethod.Settings);

            settings.AddLevel(r);

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