Example #1
0
 public bool HaveMoreThanFourLevels(CommentDC commentDC)
 {
     try
     {
         return(CommentService.HaveMoreThanFourLevels(new CommentDto
         {
             Id = commentDC.Id
         }));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Example #2
0
 public int CreateComment(CommentDC commentDC, int postId)
 {
     try
     {
         return(CommentService.CreateComment(new CommentDto
         {
             CommentText = commentDC.CommentText,
             UserName = commentDC.UserName,
             ParentId = commentDC.ParentId,
             PostId = commentDC.PostId
         }, postId));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Example #3
0
 public int DeleteComment(CommentDC commentDC)
 {
     try
     {
         return(CommentService.DeleteComment(new CommentDto
         {
             Id = commentDC.Id,
             CommentText = commentDC.CommentText,
             UserName = commentDC.UserName,
             ParentId = commentDC.ParentId,
             PostId = commentDC.PostId
         }));
     }
     catch (ApplicationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
 public CommentViewModel GetComment(int commentId)
 {
     try
     {
         CommentDC commentDC = CommentServiceClient.GetComment(commentId);
         return(new CommentViewModel
         {
             Id = commentDC.Id,
             CommentText = commentDC.CommentText,
             UserName = commentDC.UserName,
             ParentId = commentDC.ParentId,
             PostId = commentDC.PostId,
             CreationDate = commentDC.CreationDate.ToString()
         });
     }
     catch (FaultException ex)
     {
         throw new ApplicationException(ex.Message);
     }
 }