public static PrivilegeRequestDTO Map(PrivilegeRequestBO privilegeRequest, IZeus zeus)
        {
            PrivilegeRequestDTO self = new PrivilegeRequestDTO
            {
                PrivilegeRequestId = privilegeRequest.Id,
                UserId             = privilegeRequest.UserId,
                Role        = privilegeRequest.RoleName,
                RequestDate = DateExtension.ConvertDateToShort(privilegeRequest.RequestDate)
            };

            return(self);
        }
Exemple #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);
        }
Exemple #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);
        }
        public static UserTaskDTO Map(UserTaskBO userTask, IZeus zeus)
        {
            UserTaskDTO self = new UserTaskDTO
            {
                UserTaskId         = userTask.Id,
                TaskTitle          = userTask.Title,
                Description        = userTask.Description,
                AssignedToId       = userTask.UserId,
                Percentage         = DateExtension.PercentageProgressBetweenDates(userTask.BeginDate, userTask.EndDate),
                PercentageComplete = DateExtension.PercentageProgressBetweenDates(userTask.BeginDate, userTask.EndDate).ToString() + "%",
                DateCreated        = DateExtension.ConvertDateToShort(userTask.DateCreated),
                Deadline           = DateExtension.ConvertDateToShort(userTask.EndDate),
                BeginDate          = DateExtension.ConvertDateToShort(userTask.BeginDate),
                CreateDate         = userTask.DateCreated,
                UserTaskHtmlId     = StringConversion.ConvertGuidToString(userTask.Id),
                TaskHtmlId         = StringConversion.ConvertGuidToString(userTask.Id)
            };

            self.AssignedTo = userTask.User == null ? "" : userTask.User.FirstName + " " + userTask.User.LastName;

            //get list of measure/target

            return(self);
        }