Ejemplo n.º 1
0
        public static IEnumerable <UserTaskEvaluationDTO> Map(IEnumerable <UserTaskEvaluationBO> userTaskEvaluations, string currentUserId, IZeus zeus)
        {
            List <UserTaskEvaluationDTO> selfs = new List <UserTaskEvaluationDTO>();

            foreach (UserTaskEvaluationBO userTaskEvaluation in userTaskEvaluations)
            {
                UserTaskEvaluationDTO self = Map(userTaskEvaluation, currentUserId, zeus);
                selfs.Add(self);
            }
            return(selfs);
        }
Ejemplo n.º 2
0
        public static UserTaskEvaluationDTO Map(UserTaskEvaluationBO userTaskEvaluation, IZeus zeus)
        {
            UserTaskEvaluationDTO self = new UserTaskEvaluationDTO
            {
                UserTaskEvaluationId = userTaskEvaluation.Id,
                EvaluatorId          = userTaskEvaluation.EvaluatorId,
                Rating           = userTaskEvaluation.Rating,
                Score            = userTaskEvaluation.Rating + " / " + userTaskEvaluation.MaximumRating,
                Date             = userTaskEvaluation.RatingDate,
                RelativeDateTime = userTaskEvaluation.RatingDate.ToRelativeDate(),
            };

            self.EvaluatorName = userTaskEvaluation.Evaluator == null ? "" : userTaskEvaluation.Evaluator.FirstName + " " + userTaskEvaluation.Evaluator.LastName;
            return(self);
        }
Ejemplo n.º 3
0
        public static UserTaskEvaluationDTO Map(UserTaskEvaluationBO userTaskEvaluation, string currentUserId, IZeus zeus)
        {
            UserTaskEvaluationDTO self = new UserTaskEvaluationDTO
            {
                UserTaskEvaluationId = userTaskEvaluation.Id,
                EvaluatorId          = userTaskEvaluation.EvaluatorId,
                Rating           = userTaskEvaluation.Rating,
                Score            = userTaskEvaluation.Rating + " / " + userTaskEvaluation.MaximumRating,
                Date             = userTaskEvaluation.RatingDate,
                RelativeDateTime = userTaskEvaluation.RatingDate.ToRelativeDate(),
            };

            if (userTaskEvaluation.Evaluator != null)
            {
                self.EvaluatorName = userTaskEvaluation.EvaluatorId == currentUserId ? "You" : userTaskEvaluation.Evaluator.FirstName + " " + userTaskEvaluation.Evaluator.LastName;
            }

            return(self);
        }