예제 #1
0
 private void BindRepeater()
 {
     rWeightLimits.DataSource = WeightLimits.OrderBy(item => item.Amount);
     rWeightLimits.DataBind();
     rDistanceLimits.DataSource = DistanceLimits.OrderBy(item => item.Amount);
     rDistanceLimits.DataBind();
 }
예제 #2
0
        protected void rWeightLimits_Delete(object sender, RepeaterCommandEventArgs e)
        {
            var w = WeightLimits.OrderBy(x => x.Amount).ToList();

            w.RemoveAt(e.CommandArgument.ToString().TryParseInt());
            WeightLimits = w;
            BindRepeater();
        }
예제 #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            WeightLimits.Add(new ShippingByRangeWeightAndDistance.WeightLimit()
            {
                Amount  = txtAmount.Text.TryParseFloat(),
                Price   = txtPrice.Text.TryParseFloat(),
                PerUnit = chbShippingPerUnit.Checked,
            });

            BindRepeater();
            txtAmount.Text             = "";
            txtPrice.Text              = "";
            chbShippingPerUnit.Checked = false;
        }