Example #1
0
        public CommentResponse GetCommentsForDocument(CommentRequestGetByDocID DocID)
        {
            CommentResponse retval = default;

            try
            {
                var parameter = _paramConverter.ConvertToParameter(DocID, "DocID");
                var dataset   = _SQLDAL.ExecSPQuery("GetCommentsForDocument", con, parameter);
                if (dataset != null && dataset.Tables[0].Rows.Count != 0)
                {
                    retval = new CommentResponse()
                    {
                        comments = new List <CommentDTO>()
                    };
                    var commentsList = dataset.Tables[0].AsEnumerable().Select(dataRow => new CommentDTO
                    {
                        CommentID   = dataRow.Field <Guid>("CommentID"),
                        MarkerID    = dataRow.Field <Guid>("MarkerID"),
                        UserId      = dataRow.Field <string>("UserId"),
                        Content     = dataRow.Field <string>("Content"),
                        CommentDate = dataRow.Field <DateTime>("CommentDate")
                    }).ToList();
                    retval.comments = commentsList;
                }
            }
            catch (Exception e)
            {
                //log
                throw;
            }
            return(retval);
        }
Example #2
0
        public CommentResponse GetCommentsForDocument(CommentRequestGetByDocID request)
        {
            CommentResponse retval = default;

            if (request.DocID != null && request.DocID != Guid.Empty)
            {
                retval = _DAL.GetCommentsForDocument(request);
            }
            return(retval);
        }