Пример #1
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            decimal regionPrice;
            decimal regionAddPrice;

            if (!this.ValidateValues(out regionPrice, out regionAddPrice))
            {
                return;
            }
            EditShippingTemplate.Region region = new EditShippingTemplate.Region();
            region.RegionsId      = this.txtRegion_Id.Text;
            region.Regions        = this.txtRegion.Value;
            region.RegionPrice    = regionPrice;
            region.RegionAddPrice = regionAddPrice;
            this.RegionList.Add(region);
            this.BindRegion();
            this.txtRegion_Id.Text      = string.Empty;
            this.txtRegion.Value        = string.Empty;
            this.txtRegionPrice.Text    = "0";
            this.txtAddRegionPrice.Text = "0";
        }
Пример #2
0
 private void BindControl(ShippingModeInfo modeItem)
 {
     this.txtModeName.Text  = Globals.HtmlDecode(modeItem.Name);
     this.txtWeight.Text    = modeItem.Weight.ToString("F2");
     this.txtAddWeight.Text = modeItem.AddWeight.GetValueOrDefault().ToString("F2");
     if (modeItem.AddPrice.HasValue)
     {
         this.txtAddPrice.Text = modeItem.AddPrice.Value.ToString("F2");
     }
     this.txtPrice.Text = modeItem.Price.ToString("F2");
     this.RegionList.Clear();
     if (modeItem.ModeGroup != null && modeItem.ModeGroup.Count > 0)
     {
         foreach (ShippingModeGroupInfo current in modeItem.ModeGroup)
         {
             EditShippingTemplate.Region region = new EditShippingTemplate.Region();
             region.RegionPrice    = decimal.Parse(current.Price.ToString("F2"));
             region.RegionAddPrice = decimal.Parse(current.AddPrice.ToString("F2"));
             System.Text.StringBuilder stringBuilder  = new System.Text.StringBuilder();
             System.Text.StringBuilder stringBuilder2 = new System.Text.StringBuilder();
             foreach (ShippingRegionInfo current2 in current.ModeRegions)
             {
                 stringBuilder.Append(current2.RegionId + ",");
                 stringBuilder2.Append(RegionHelper.GetFullRegion(current2.RegionId, ",") + ",");
             }
             if (!string.IsNullOrEmpty(stringBuilder.ToString()))
             {
                 region.RegionsId = stringBuilder.ToString().Substring(0, stringBuilder.ToString().Length - 1);
             }
             if (!string.IsNullOrEmpty(stringBuilder2.ToString()))
             {
                 region.Regions = stringBuilder2.ToString().Substring(0, stringBuilder2.ToString().Length - 1);
             }
             this.RegionList.Add(region);
         }
     }
 }