示例#1
0
        public static dtoItemWeightSettings Create(ItemWeightSettings item, Boolean useFatherManualWeights)
        {
            DssError error = DssError.None;

            if (item.ManualWeights)
            {
                if (String.IsNullOrWhiteSpace(item.FuzzyMeWeights))
                {
                    error = DssError.MissingManualWeight;
                }
                else if (!item.IsValidFuzzyMeWeights)
                {
                    error = DssError.InvalidManualWeight;
                }
            }
            else if (!useFatherManualWeights)
            {
                if (item.IdRatingValue < 1)
                {
                    error = DssError.MissingWeight;
                }
                else if (item.IdRatingValueEnd < 1 && item.RatingType != RatingType.simple)
                {
                    error = DssError.MissingWeight;
                }
            }
            return(Create(item, useFatherManualWeights, error));
        }
示例#2
0
        public ItemWeightSettings Copy()
        {
            ItemWeightSettings dto = new ItemWeightSettings();

            dto.IdRatingValue         = IdRatingValue;
            dto.IdRatingValueEnd      = IdRatingValueEnd;
            dto.Weight                = Weight;
            dto.WeightFuzzy           = WeightFuzzy;
            dto.IsFuzzyWeight         = IsFuzzyWeight;
            dto.RatingType            = RatingType;
            dto.FuzzyMeWeights        = FuzzyMeWeights;
            dto.ManualWeights         = ManualWeights;
            dto.IsValidFuzzyMeWeights = IsValidFuzzyMeWeights;
            return(dto);
        }
示例#3
0
        public static dtoItemWeightSettings Create(ItemWeightSettings item, Boolean useFatherManualWeights, DssError error)
        {
            dtoItemWeightSettings dto = new dtoItemWeightSettings();

            dto.IdRatingValue          = item.IdRatingValue;
            dto.IdRatingValueEnd       = item.IdRatingValueEnd;
            dto.Weight                 = item.Weight;
            dto.WeightFuzzy            = item.WeightFuzzy;
            dto.IsFuzzyWeight          = item.IsFuzzyWeight;
            dto.RatingType             = item.RatingType;
            dto.FuzzyMeWeights         = item.FuzzyMeWeights;
            dto.ManualWeights          = item.ManualWeights;
            dto.IsValidFuzzyMeWeights  = item.IsValidFuzzyMeWeights;
            dto.UseFatherManualWeights = useFatherManualWeights;
            dto.Error = error;

            return(dto);
        }