public bool HaveMoreThanFourLevels(CommentDC commentDC) { try { return(CommentService.HaveMoreThanFourLevels(new CommentDto { Id = commentDC.Id })); } catch (ApplicationException ex) { throw new FaultException(ex.Message); } }
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); } }
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); } }