コード例 #1
0
 public bool HaveMoreThanFourLevels(CommentSoap commentSoap)
 {
     try
     {
         return(CommentService.HaveMoreThanFourLevels(new CommentDto
         {
             Id = commentSoap.Id
         }));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
コード例 #2
0
 public int CreateComment(CommentSoap commentSoap, int postId)
 {
     try
     {
         return(CommentService.CreateComment(new CommentDto
         {
             CommentText = commentSoap.CommentText,
             UserName = commentSoap.UserName,
             ParentId = commentSoap.ParentId,
             PostId = commentSoap.PostId
         }, postId));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
コード例 #3
0
 public int DeleteComment(CommentSoap commentSoap)
 {
     try
     {
         return(CommentService.DeleteComment(new CommentDto
         {
             Id = commentSoap.Id,
             CommentText = commentSoap.CommentText,
             UserName = commentSoap.UserName,
             ParentId = commentSoap.ParentId,
             PostId = commentSoap.PostId
         }));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
コード例 #4
0
 public CommentViewModel GetComment(int commentId)
 {
     try
     {
         CommentSoap comment = CommentServiceClient.GetComment(commentId);
         return(new CommentViewModel
         {
             Id = comment.Id,
             CommentText = comment.CommentText,
             UserName = comment.UserName,
             ParentId = comment.ParentId,
             PostId = comment.PostId,
             CreationDate = comment.CreationDate.ToString()
         });
     }
     catch (FaultException ex)
     {
         throw new ApplicationException(ex.Message);
     }
 }