コード例 #1
0
 public PricingEveryday(
     int id,
     string searchGroupKey,
     PricingIdentity identity,
     List <FilterGroup> filterGroups,
     List <PricingEverydayValueDriver> valueDrivers,
     PricingEverydayKeyValueDriver keyValueDriver,
     List <PricingEverydayLinkedValueDriver> linkedValueDrivers,
     List <PricingMode> pricingModes,
     List <PricingEverydayPriceListGroup> priceListGroups,
     PricingKeyPriceListRule keyPriceListRule,
     List <PricingLinkedPriceListRule> linkedPriceListRules,
     List <PricingEverydayResult> results
     )
 {
     Id                   = id;
     SearchGroupKey       = searchGroupKey;
     Identity             = identity;
     FilterGroups         = filterGroups;
     ValueDrivers         = valueDrivers;
     KeyValueDriver       = keyValueDriver;
     LinkedValueDrivers   = linkedValueDrivers;
     PricingModes         = pricingModes;
     PriceListGroups      = priceListGroups;
     KeyPriceListRule     = keyPriceListRule;
     LinkedPriceListRules = linkedPriceListRules;
     Results              = results;
 }
コード例 #2
0
 public PricingEveryday(
     int id,
     List <PricingMode> pricingModes,
     PricingKeyPriceListRule keyPriceListRule,
     List <PricingLinkedPriceListRule> linkedPriceListRules
     )
 {
     Id                   = id;
     PricingModes         = pricingModes;
     KeyPriceListRule     = keyPriceListRule;
     LinkedPriceListRules = linkedPriceListRules;
 }
コード例 #3
0
        public static DTO.PricingKeyPriceListRule ToDto(this Display.PricingKeyPriceListRule displayEntity)
        {
            List <DTO.PriceRoundingRule> roundingRules = displayEntity.RoundingRules.ToDtoList();
            List <DTO.SQLEnumeration>    roundingTypes = displayEntity.RoundingTypes.ToDTOList();

            var dto = new DTO.PricingKeyPriceListRule(
                displayEntity.PriceListId,
                displayEntity.DollarRangeLower,
                displayEntity.DollarRangeUpper,
                roundingRules, roundingTypes);

            return(dto);
        }
コード例 #4
0
        public static Display.PricingKeyPriceListRule ToDisplayEntity(this DTO.PricingKeyPriceListRule dto)
        {
            var displayEntity = new Display.PricingKeyPriceListRule();

            displayEntity.PriceListId      = dto.PriceListId;
            displayEntity.DollarRangeLower = dto.DollarRangeLower;
            displayEntity.DollarRangeUpper = dto.DollarRangeUpper;

            if (dto.RoundingRules != null)
            {
                displayEntity.RoundingRules = dto.RoundingRules.ToDisplayList();
            }

            return(displayEntity);
        }
コード例 #5
0
        public static DTO.PricingEveryday ToDto(this Display.PricingEveryday displayEntity)
        {
            DTO.PricingIdentity identity = displayEntity.Identity.ToDto();

            var filterGroups = new List <DTO.FilterGroup>();

            if (displayEntity.FilterGroups != null)
            {
                foreach (var filterGroup in displayEntity.FilterGroups)
                {
                    filterGroups.Add(filterGroup.ToDto());
                }
            }

            var valueDrivers = new List <DTO.PricingEverydayValueDriver>();

            if (displayEntity.ValueDrivers != null)
            {
                foreach (var driver in displayEntity.ValueDrivers)
                {
                    valueDrivers.Add(driver.ToDto());
                }
            }
            DTO.PricingEverydayKeyValueDriver keyValueDriver = new DTO.PricingEverydayKeyValueDriver();
            if (displayEntity.KeyValueDriver != null)
            {
                keyValueDriver = displayEntity.KeyValueDriver.ToDto();
            }

            var linkedValueDrivers = new List <DTO.PricingEverydayLinkedValueDriver>();

            if (displayEntity.LinkedValueDrivers != null)
            {
                foreach (var driver in displayEntity.LinkedValueDrivers)
                {
                    linkedValueDrivers.Add(driver.ToDto());
                }
            }

            var pricingModes = new List <DTO.PricingMode>();

            if (displayEntity.PricingModes != null)
            {
                foreach (var mode in displayEntity.PricingModes)
                {
                    pricingModes.Add(mode.ToDto());
                }
            }

            var priceListGroups = new List <DTO.PricingEverydayPriceListGroup>();

            if (displayEntity.PriceListGroups != null)
            {
                foreach (var priceListGroup in displayEntity.PriceListGroups)
                {
                    priceListGroups.Add(priceListGroup.ToDto());
                }
            }

            DTO.PricingKeyPriceListRule keyPriceListRule = new DTO.PricingKeyPriceListRule();
            if (displayEntity.KeyPriceListRule != null)
            {
                keyPriceListRule = displayEntity.KeyPriceListRule.ToDto();
            }

            var linkedPriceListRules = new List <DTO.PricingLinkedPriceListRule>();

            if (displayEntity.LinkedPriceListRules != null)
            {
                foreach (var rule in displayEntity.LinkedPriceListRules)
                {
                    linkedPriceListRules.Add(rule.ToDto());
                }
            }

            var results = new List <DTO.PricingEverydayResult>();

            if (displayEntity.Results != null)
            {
                foreach (var result in displayEntity.Results)
                {
                    results.Add(result.ToDto());
                }
            }

            DTO.PricingEveryday dto = new DTO.PricingEveryday(
                displayEntity.Id,
                displayEntity.SearchGroupKey,
                identity,
                filterGroups,
                valueDrivers,
                keyValueDriver,
                linkedValueDrivers,
                pricingModes,
                priceListGroups,
                keyPriceListRule,
                linkedPriceListRules,
                results);
            return(dto);
        }