Esempio n. 1
0
        public ItemRating Copy()
        {
            ItemRating dto = new ItemRating();

            dto.IdRatingValue    = IdRatingValue;
            dto.IdRatingValueEnd = IdRatingValueEnd;
            dto.Value            = Value;
            dto.ValueFuzzy       = ValueFuzzy;
            dto.IsFuzzy          = IsFuzzy;
            dto.RatingType       = RatingType;

            return(dto);
        }
Esempio n. 2
0
        public static dtoItemRating Create(ItemRating item, DssError error)
        {
            dtoItemRating dto = new dtoItemRating();

            dto.IdRatingValue    = item.IdRatingValue;
            dto.IdRatingValueEnd = item.IdRatingValueEnd;
            dto.Value            = item.Value;
            dto.ValueFuzzy       = item.ValueFuzzy;
            dto.IsFuzzy          = item.IsFuzzy;
            dto.RatingType       = item.RatingType;
            dto.Error            = error;

            return(dto);
        }
Esempio n. 3
0
        public static dtoItemRating Create(ItemRating item)
        {
            DssError error = DssError.None;

            if (item != null)
            {
                if (item.IdRatingValue < 1)
                {
                    error = DssError.MissingRating;
                }
                else if (item.IdRatingValueEnd < 1 && item.RatingType != RatingType.simple)
                {
                    error = DssError.MissingRating;
                }
                return(Create(item, error));
            }
            else
            {
                return(new dtoItemRating()
                {
                    Error = DssError.MissingRating
                });
            }
        }