Exemplo n.º 1
0
        public static IEnumerable <UserTaskCommentDTO> Map(IEnumerable <UserTaskCommentBO> userTaskComments, string currentUserId, IZeus zeus)
        {
            List <UserTaskCommentDTO> selfs = new List <UserTaskCommentDTO>();

            foreach (UserTaskCommentBO userTaskComment in userTaskComments)
            {
                UserTaskCommentDTO self = UserTaskCommentDTO.Map(userTaskComment, currentUserId, zeus);
                selfs.Add(self);
            }
            return(selfs);
        }
Exemplo n.º 2
0
        public static UserTaskCommentDTO Map(UserTaskCommentBO userTaskComment, IZeus zeus)
        {
            UserTaskCommentDTO self = new UserTaskCommentDTO
            {
                UserTaskCommentId = userTaskComment.Id,
                UserTaskId        = userTaskComment.UserTaskId,
                CommenterId       = userTaskComment.CommenterId,
                Comment           = userTaskComment.Comment,
                CommentDate       = DateExtension.ConvertDateToShort(userTaskComment.CommentDate),
                Date             = userTaskComment.CommentDate,
                RelativeDateTime = userTaskComment.CommentDate.ToRelativeDate(),
            };

            self.CommenterName = userTaskComment.Commenter == null ? "" : userTaskComment.Commenter.FirstName + " " + userTaskComment.Commenter.LastName;

            return(self);
        }
Exemplo n.º 3
0
        public static UserTaskCommentDTO Map(UserTaskCommentBO userTaskComment, string currentUserId, IZeus zeus)
        {
            UserTaskCommentDTO self = new UserTaskCommentDTO
            {
                UserTaskCommentId = userTaskComment.Id,
                UserTaskId        = userTaskComment.UserTaskId,
                CommenterId       = userTaskComment.CommenterId,
                Comment           = userTaskComment.Comment,
                CommentDate       = DateExtension.ConvertDateToShort(userTaskComment.CommentDate),
                Date             = userTaskComment.CommentDate,
                RelativeDateTime = userTaskComment.CommentDate.ToRelativeDate(),
                IsCommenter      = userTaskComment.CommenterId == currentUserId
            };

            if (userTaskComment.Commenter != null)
            {
                self.CommenterName = userTaskComment.CommenterId == currentUserId ? "You" : userTaskComment.Commenter.FirstName + " " + userTaskComment.Commenter.LastName;
            }
            return(self);
        }