/// <summary>
 /// 根据ID得到运送方式的名字
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 protected string GetDeliverById(int id)
 {
     ShowShop.BLL.Product.Deliver bll = new ShowShop.BLL.Product.Deliver();
     ShowShop.Model.Product.Deliver model = bll.GetModelByID(id);
     if (model != null)
     {
         return model.Name.ToString();
     }
     else
     {
         return "无该运送方式名称";
     }
 }
        /// <summary>
        /// 显示编辑信息
        /// </summary>
        /// <param name="id"></param>
        protected void BandInfo(int id)
        {
            ShowShop.BLL.Product.Deliver bll = new ShowShop.BLL.Product.Deliver();
            ShowShop.Model.Product.Deliver model = bll.GetModelByID(id);
            this.txtName.Text = model.Name;
            this.txtInceptPrice.Text = model.InceptPrice.ToString();
            this.txtInceptWeight.Text = model.InceptWeight.ToString();
            this.rblArrivePay.SelectedValue = model.ArrivePay.ToString();
            this.txtDescription.Text = model.Description;
            this.txtAddPricelAdder.Text = model.AddPriceLadder.ToString();
            this.txtAddWeightlAdder.Text = model.AddWeightLadder.ToString();
            this.rblIsSpecial.SelectedValue = model.IsSpecial.ToString();
            this.rblisused.SelectedValue = model.IsUsed.ToString();
            this.txtSort.Text = model.Sort.ToString();
            string[] str = model.BoundPrice.Split('|');
            for (int i = 0; i < str.Length; i++)
            {
                if (i == 0)
                {
                    string[] arr0 = str[i].Split(',');
                    for (int j = 0; j < arr0.Length; j++)
                    {
                        this.txtBoundU1.Text = arr0[0];
                        this.txtBoundD1.Text = arr0[1];
                        this.txtBoundP1.Text = arr0[2];
                    }
                }
                else if(i==1)
                {
                    string[] arr1 = str[i].Split(',');
                    for (int j = 0; j < arr1.Length; j++)
                    {
                        this.txtBoundU2.Text = arr1[0];
                        this.txtBoundD2.Text = arr1[1];
                        this.txtBoundP2.Text = arr1[2];
                    }
                }
                else if (i == 2)
                {
                    string[] arr2 = str[i].Split(',');
                    for (int j = 0; j < arr2.Length; j++)
                    {
                        this.txtBoundU3.Text = arr2[0];
                        this.txtBoundD3.Text = arr2[1];
                        this.txtBoundP3.Text = arr2[2];
                    }
                }
                else if (i == 3)
                {
                    string[] arr3 = str[i].Split(',');
                    for (int j = 0; j < arr3.Length; j++)
                    {
                        this.txtBoundU4.Text = arr3[0];
                        this.txtBoundD4.Text = arr3[1];
                        this.txtBoundP4.Text = arr3[2];
                    }
                }
            }

            ViewState["ID"] = model.ID.ToString();
            ViewState["PutoutID"] = model.PutoutId.ToString();
            ViewState["PutoutTyID"] = model.PutouttyId.ToString();
        }
 /// <summary>
 /// 调整是否使用
 /// </summary>
 /// <param name="id"></param>
 private void SetUse(int id)
 {
     ShowShop.BLL.Product.Deliver bll = new ShowShop.BLL.Product.Deliver();
     ShowShop.Model.Product.Deliver model = bll.GetModelByID(id);
     if (model.IsUsed == 0)
     {
         bll.Amend(id, "isused", 1);
         Response.Write("ok");
     }
     else
     {
         bll.Amend(id, "isused", 0);
         Response.Write("ok");
     }
 }