示例#1
0
文件: InterView.cs 项目: dkme/moooyo
 /// <summary>
 /// 更新访谈喜欢数量
 /// </summary>
 /// <param name="interviewID">访谈编号</param>
 /// <returns></returns>
 public Boolean UpdateLikeCount(String interviewID)
 {
     try
     {
         InterView obj = new InterView();
         obj = InterViewProvider.GetInterView(interviewID);
         if (obj != null)
         {
             obj.LikeCount = Like.LikeDataFactory.GetLike<Like.LikeData>(null, interviewID, Like.LikeType.InterView, Like.LikeData.GetCollectionName()).Count;
             obj.Save(obj);
         }
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
示例#2
0
文件: InterView.cs 项目: dkme/moooyo
 /// <summary>
 /// 更新内容的回复显示集合,工厂方法
 /// </summary>
 /// <param name="ID">回复对象</param>
 /// <returns>操作是否成功</returns>
 public Boolean UpdateCommentList(Comment.Comment comment)
 {
     try
     {
         InterView obj = new InterView();
         obj = InterViewProvider.GetInterView(comment.CommentToID);
         if (obj.AnswerList != null)
         {
             if (obj.AnswerList.Count >= 6)
             {
                 obj.AnswerList.Insert(0, comment);
                 obj.AnswerList.RemoveAt(obj.AnswerList.Count - 1);
             }
             else
             {
                 obj.AnswerList.Insert(0, comment);
             }
         }
         else
         {
             List<Comment.Comment> commentlist = new List<Comment.Comment>();
             commentlist.Add(comment);
             obj.AnswerList = commentlist;
         }
         obj.AnswerCount = Comment.CommentProvider.findForTypeCount(comment.CommentToID, Comment.CommentType.InterView, Comm.DeletedFlag.No);
         obj.Save(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }