Ejemplo n.º 1
0
        public static List <ObjectComment> GetComments(Guid?userId, DateTime?createdFrom, DateTime?createdTo, string text, Guid?objectId, string username, string generalSearchParam, int?pageNum, int?pageSize, string sortAttr, string sortDir, out int numberItems)
        {
            List <ObjectComment> commentList = new List <ObjectComment>();

            int?refNumberItems        = null;
            CSBooster_DataContext cdc = new CSBooster_DataContext(Helper.GetSiemeConnectionString());
            var commentResults        = cdc.hisp_Comments_GetComments(userId, createdFrom, createdTo, "%" + text + "%", objectId, "%" + username + "%", "%" + generalSearchParam + "%", pageNum, pageSize, sortAttr, sortDir, ref refNumberItems);

            foreach (CommentResult commentResult in commentResults)
            {
                ObjectComment comment = new ObjectComment();
                ObjectComment.FillComment(comment, commentResult);
                commentList.Add(comment);
            }

            numberItems = refNumberItems.Value;

            return(commentList);
        }