public IEnumerable <ReviewStatusDto> GetReviewStatuses()
        {
            var values = Enum.GetValues(typeof(ReviewStatus));

            var statuses  = new List <ReviewStatusDto>();
            int sortOrder = 1;

            foreach (ReviewStatus val in values)
            {
                var name  = val.ToString();
                var color = ReviewHelper.GetStatusColor(val);

                statuses.Add(new ReviewStatusDto
                {
                    Alias     = name.ToLower(),
                    Color     = color,
                    Id        = (int)val,
                    Name      = name,
                    SortOrder = sortOrder
                });

                sortOrder++;
            }

            return(statuses);
        }
Esempio n. 2
0
        public static ReviewStatusDto ReviewStatusToDto(ReviewStatus reviewStatus)
        {
            var name  = reviewStatus.ToString();
            var color = ReviewHelper.GetStatusColor(reviewStatus);

            return(new ReviewStatusDto
            {
                Alias = name.ToLower(),
                Id = (int)reviewStatus,
                Color = color,
                Name = name,
                SortOrder = 0
            });
        }