Exemplo n.º 1
0
        public static DTO.PricingLinkedPriceListRule ToDto(this Display.PricingLinkedPriceListRule displayEntity)
        {
            List <DTO.PriceRoundingRule> roundingRules = displayEntity.RoundingRules.ToDtoList();
            List <DTO.SQLEnumeration>    roundingTypes = displayEntity.RoundingTypes.ToDTOList();

            var dto = new DTO.PricingLinkedPriceListRule(
                displayEntity.PriceListId,
                displayEntity.PercentChange,
                roundingRules,
                roundingTypes);

            return(dto);
        }
Exemplo n.º 2
0
        public static Display.PricingLinkedPriceListRule ToDisplayEntity(this DTO.PricingLinkedPriceListRule dto)
        {
            var displayEntity = new Display.PricingLinkedPriceListRule();

            displayEntity.PriceListId   = dto.PriceListId;
            displayEntity.PercentChange = (int)dto.PercentChange;

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

            return(displayEntity);
        }