Esempio n. 1
0
 //赋值操作
 private void ShowInfo(int _id)
 {
     Spread.BLL.Products bll = new Spread.BLL.Products();
     Spread.Model.Products model = bll.GetModel(_id);
     ddlClassId.SelectedValue = model.ClassId.ToString();
     txtTitle.Text = model.Title;
     txtBrand.Text=model.Brand;
     txtAuthor.Text = model.AddUser;
     txtKeyword.Text = model.Keyword;
     cbIsTop.Checked = model.IsTop;
     cbIsLock.Checked=model.IsLock;            
 }
Esempio n. 2
0
 //保存
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Spread.BLL.Products bll = new Spread.BLL.Products();
     Spread.Model.Products model = bll.GetModel(this.Id);
     model.Title = txtTitle.Text.Trim();
     model.Brand = txtBrand.Text.Trim();
     model.AddUser = txtAuthor.Text.Trim();
     model.ClassId = int.Parse(ddlClassId.SelectedValue);
     model.ImgUrl = "";
     model.Url ="";
     model.Keyword = txtKeyword.Text;
     model.IsTop = cbIsTop.Checked;
     model.IsLock = cbIsLock.Checked;
     model.AddTime = DateTime.Now;
     bll.Update(model);
     JscriptPrint("产品编辑成功啦!", "List.aspx", "Success");
 }
Esempio n. 3
0
 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);
     Spread.BLL.Products bll = new Spread.BLL.Products();
     Spread.Model.Products model = bll.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtntop":
             if (model.IsTop == true)
                 bll.UpdateField(id, "IsTop=0");
             else
                 bll.UpdateField(id, "IsTop=1");
             break;
         case "ibtnlock":
             if (model.IsLock == true)
                 bll.UpdateField(id, "IsLock=0");
             else
                 bll.UpdateField(id, "IsLock=1");
             break;
     }
     RptBind("Id>0" + this.CombSqlTxt(this.classId, this.keywords, this.property), "AddTime desc");
 }