protected void A_Collect(object sender, EventArgs e) { HtmlAnchor a = sender as HtmlAnchor; string goodsid = a.Attributes["collect"]; List <Hi.Model.BD_DisCollect> list = new Hi.BLL.BD_DisCollect().GetList("", " disID='" + this.DisID + "' and compID='" + this.CompID + "' and goodsID='" + goodsid + "'", ""); if (list.Count > 0) { if (new Hi.BLL.BD_DisCollect().delete(this.DisID, int.Parse(goodsid))) { page = Pagers.CurrentPageIndex.ToString(); Bind(); } } else { Hi.Model.BD_DisCollect collect = new Hi.Model.BD_DisCollect(); collect.CompID = this.CompID; collect.DisID = this.DisID; collect.DisUserID = this.UserID; collect.GoodsID = int.Parse(goodsid); collect.IsEnabled = 1; collect.CreateDate = DateTime.Now; collect.CreateUserID = this.UserID; collect.ts = DateTime.Now; if (new Hi.BLL.BD_DisCollect().Add(collect) > 0) { page = Pagers.CurrentPageIndex.ToString(); Bind(); } } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hi.Model.BD_DisCollect model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hi.Model.BD_DisCollect model) { return(dal.Add(model)); }