예제 #1
0
파일: D_CommentDao.cs 프로젝트: uvbs/tumumi
        /// <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));
        }
예제 #2
0
파일: D_CommentDao.cs 프로젝트: uvbs/tumumi
        /// <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);
        }
예제 #3
0
        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();
        }
예제 #4
0
 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");
     }
 }
예제 #5
0
파일: D_CommentBLL.cs 프로젝트: uvbs/tumumi
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>返回:ture 成功,false 失败</returns>
 public bool Update(D_Comment obj)
 {
     return(dal.Update(obj));
 }
예제 #6
0
파일: D_CommentBLL.cs 프로젝트: uvbs/tumumi
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="obj">对象</param>
 /// <returns>返回:该条数据的主键Id</returns>
 public int Insert(D_Comment obj)
 {
     return(dal.Insert(obj));
 }