/// <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");
     }
 }
 protected void lbtnSave_Click(object sender, EventArgs e)
 {
     //try
     //{
         ShowShop.BLL.Product.Deliver bll = new ShowShop.BLL.Product.Deliver();
         ShowShop.Model.Product.Deliver model = new ShowShop.Model.Product.Deliver();
         if (!ChangeHope.Common.ValidateHelper.IsMoney(txtInceptPrice.Text) || !ChangeHope.Common.ValidateHelper.IsNumber(txtInceptWeight.Text) || !ChangeHope.Common.ValidateHelper.IsMoney(txtAddPricelAdder.Text) || !ChangeHope.Common.ValidateHelper.IsMoney(txtAddWeightlAdder.Text) || !ChangeHope.Common.ValidateHelper.IsNumber(txtBoundU1.Text) || !ChangeHope.Common.ValidateHelper.IsNumber(txtBoundD1.Text) || !ChangeHope.Common.ValidateHelper.IsMoney(txtBoundP1.Text))
         {
             this.ltlMsg.Text = "操作失败,请输入正确的价格或者数字";
             this.pnlMsg.Visible = true;
             this.pnlMsg.CssClass = "actionErr";
             return;
         }
         if (float.Parse(txtInceptPrice.Text) <= 0 || float.Parse(txtInceptWeight.Text) <= 0 || float.Parse(txtAddPricelAdder.Text) <= 0 || float.Parse(txtAddWeightlAdder.Text) <= 0 || float.Parse(txtBoundU1.Text) <= 0 || float.Parse(txtBoundD1.Text) <= 0 || float.Parse(txtBoundP1.Text)<=0 )
         {
             this.ltlMsg.Text = "操作失败,价格与重量数不能小于或者等于0";
             this.pnlMsg.Visible = true;
             this.pnlMsg.CssClass = "actionErr";
             return;
         }
         model.Name = this.txtName.Text.Trim();
         model.InceptPrice = Convert.ToDecimal(this.txtInceptPrice.Text.Trim());
         model.InceptWeight = Convert.ToDecimal(this.txtInceptWeight.Text.Trim());
         model.ArrivePay = Convert.ToInt32(this.rblArrivePay.SelectedValue);
         model.Description = this.txtDescription.Text.Trim();
         model.AddPriceLadder = Convert.ToDecimal(this.txtAddPricelAdder.Text.Trim());
         model.AddWeightLadder = Convert.ToDecimal(this.txtAddWeightlAdder.Text.Trim());
         model.BoundPrice = GetBoundPrice();
         model.IsSpecial = Convert.ToInt32(this.rblIsSpecial.SelectedValue);
         model.IsUsed = Convert.ToInt32(this.rblisused.SelectedValue);
         model.Sort = Convert.ToInt32(this.txtSort.Text.Trim());
         if (ViewState["ID"] != null)//更新
         {
             model.ID = Convert.ToInt32(ViewState["ID"].ToString());
             model.PutoutId = Convert.ToInt32(ViewState["PutoutID"]);
             model.PutouttyId = Convert.ToInt32(ViewState["PutoutTyID"]);
             bll.Amend(model);
         }
         else//添加
         {
             ShowShop.Model.Admin.AdminInfo adminModel = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get();
             //管理员ID
             model.PutoutId = adminModel.AdminId;
             model.PutouttyId = 0;
             bll.Add(model);
         }
         this.ltlMsg.Text = "操作成功,已保存该信息";
         this.pnlMsg.Visible = true;
         this.pnlMsg.CssClass = "actionOk";
     //}
     //catch
     //{
     //    this.ltlMsg.Text = "操作失败,请查看数据格式是否符合要求";
     //    this.pnlMsg.Visible = true;
     //    this.pnlMsg.CssClass = "actionErr";
     //}
 }
 /// <summary>
 /// 修改优先级
 /// </summary>
 /// <param name="id"></param>
 /// <param name="sort"></param>
 private void SetSort(int id, int sort)
 {
     ShowShop.BLL.Product.Deliver bll = new ShowShop.BLL.Product.Deliver();
     bll.Amend(id, "sort", sort);
     Response.Write("ok");
 }