예제 #1
0
 public List<CommentInfo> GetOwnComments(long postId, int pageId, int pageSize, bool isWeb)
 {
     try
     {
         CommentManager mgr = new CommentManager();
         HelperMethods helperMgr = new HelperMethods();
         Guid userIdf = helperMgr.GetUserIdf(isWeb, HttpContext.Current);
         return mgr.GetOwnComments(userIdf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb));
     }
     catch (Exception ex)
     {
         throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError);
     }
 }
예제 #2
0
 public List<CommentInfo> GetComments(long postId, int pageId, int pageSize, bool isWeb)
 {
     try
     {
         CommentManager mgr = new CommentManager();
         HelperMethods helperMgr = new HelperMethods();
         TokenInfo tokenInfo = new HelperMethods().GetUserToken<TokenInfo>(isWeb, HttpContext.Current);
         PostInfo post = new PostManager().GetPostById(tokenInfo.Idf, 0, tokenInfo.FolderPath, postId);
         if (post.isDone == true)
             return mgr.GetComments(tokenInfo.Idf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb));
         else
             return mgr.GetOwnComments(tokenInfo.Idf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb));
     }
     catch (Exception ex)
     {
         throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError);
     }
 }