/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(D_Comment obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "D_Comment.Insert"; return(SqlMapper.Instance().QueryForObject <int>(stmtId, obj)); }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(D_Comment obj) { if (obj == null) { throw new ArgumentNullException("obj"); } String stmtId = "D_Comment.Update"; int result = SqlMapper.Instance().QueryForObject <int>(stmtId, obj); return(result > 0 ? true : false); }
public void SetCommentDisp(int[] commentIds, bool isDisp) { DocService ds = Context.GetService <DocService>(); foreach (int cid in commentIds) { D_Comment dc = ds.DCommentBll.Get(cid); if (dc != null) { dc.IsDisp = isDisp; ds.DCommentBll.Update(dc); } } base.SuccessInfo(); RedirectToReferrer(); }
public void InsertComment([DataBind("D_Comment")] D_Comment model) { try { DocService ds = Context.GetService <DocService>(); model.Content = model.Content.ToUrlDecode().FilterHtml(); model.CreateTime = DateTime.Now; model.IsDisp = true; ds.DCommentBll.Insert(model); //更新评论量 ds.DDocInfoBll.UpdateCommentCount(model.DocId); RenderText("1"); } catch (Exception ex) { Utils.Log4Net.Error(ex); RenderText("-1"); } }
/// <summary> /// 更新数据 /// </summary> /// <param name="obj"></param> /// <returns>返回:ture 成功,false 失败</returns> public bool Update(D_Comment obj) { return(dal.Update(obj)); }
/// <summary> /// 插入数据 /// </summary> /// <param name="obj">对象</param> /// <returns>返回:该条数据的主键Id</returns> public int Insert(D_Comment obj) { return(dal.Insert(obj)); }