Exemplo n.º 1
0
 /// <summary>
 /// 更新喜欢的数量
 /// </summary>
 /// <param name="contentID">内容编号</param>
 /// <returns></returns>
 public static Boolean UpdateLikeCount(String contentID)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(contentID);
         obj.LikeCount = Like.LikeDataFactory.GetLike<Like.LikeData>(null, contentID, Like.LikeType.Content, Like.LikeData.GetCollectionName()).Count;
         obj.UpdateTime = DateTime.Now;
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 更新内容的回复显示集合,工厂方法
 /// </summary>
 /// <param name="ID">回复对象</param>
 /// <returns>操作是否成功</returns>
 public Boolean UpdateCommentList(Comment.Comment comment)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(comment.CommentToID);
         if (obj.AnswerList.Count >= 6)
         {
             obj.AnswerList.Insert(0, comment);
             obj.AnswerList.RemoveAt(obj.AnswerList.Count - 1);
         }
         else
         {
             obj.AnswerList.Insert(0, comment);
         }
         obj.AnswerCount = Comment.CommentProvider.findForContentCount(comment.CommentToID, Comm.DeletedFlag.No);
         obj.UpdateTime = DateTime.Now;
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Exemplo n.º 3
0
 /*
 /// <summary>
 /// 更新喜欢的集合
 /// </summary>
 /// <param name="comment">回复的内容</param>
 /// <returns>操作是否成功</returns>
 public static Boolean UpdateLikeList(Comment.Comment comment)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(comment.CommentToID);
         obj.LikeList.Insert(0, comment);
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }*/
 /// <summary>
 /// 更新访谈内容的访谈集合
 /// </summary>
 /// <param name="contentID">内容编号</param>
 /// <param name="interviewID">访谈编号</param>
 /// <returns></returns>
 public static Boolean UpdateInterViewList(String contentID, String interviewID)
 {
     try
     {
         PublicContent obj = new PublicContent();
         InterViewContent interviewcontent = (InterViewContent)obj.getPublicContent(contentID);
         InterView.InterView interview = InterView.InterViewProvider.GetInterView(interviewID);
         for (int i = 0; i < interviewcontent.InterviewList.Count; i++)
         {
             if (interviewcontent.InterviewList[i].ID == interviewID)
             {
                 interviewcontent.InterviewList.RemoveAt(i);
                 interviewcontent.InterviewList.Insert(i, interview);
                 break;
             }
         }
         obj.savePublicContent((PublicContent)interviewcontent);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }