示例#1
0
        public static Display.PricingEverydayResultPriceList ToDisplayEntity(this DTO.PricingEverydayResultPriceList dto)
        {
            var displayEntity = new Display.PricingEverydayResultPriceList();

            displayEntity.ResultId             = dto.ResultId;
            displayEntity.CurrentPrice         = dto.CurrentPrice;
            displayEntity.NewPrice             = dto.NewPrice;
            displayEntity.CurrentMarkupPercent = dto.CurrentMarkupPercent;
            displayEntity.NewMarkupPercent     = dto.NewMarkupPercent;
            displayEntity.KeyValueChange       = dto.KeyValueChange;
            displayEntity.InfluenceValueChange = dto.InfluenceValueChange;
            displayEntity.PriceChange          = dto.PriceChange;

            if (dto.PriceEdit != null)
            {
                displayEntity.PriceEdit = dto.PriceEdit.ToDisplayEntity();
            }

            if (dto.PriceWarning != null)
            {
                displayEntity.PriceWarning = dto.PriceWarning.ToDisplayEntity();
            }

            displayEntity.IsKey      = dto.IsKey;
            displayEntity.Id         = dto.Id;
            displayEntity.Key        = dto.Key;
            displayEntity.Code       = dto.Code;
            displayEntity.Name       = dto.Name;
            displayEntity.Title      = dto.Title;
            displayEntity.Sort       = dto.Sort;
            displayEntity.IsSelected = dto.IsSelected;

            return(displayEntity);
        }
示例#2
0
        public static DTO.PricingEverydayResultPriceList ToDto(this Display.PricingEverydayResultPriceList displayEntity)
        {
            var dto = new DTO.PricingEverydayResultPriceList(displayEntity.ResultId,
                                                             displayEntity.Id,
                                                             displayEntity.Key,
                                                             displayEntity.Code,
                                                             displayEntity.Name,
                                                             displayEntity.Sort,
                                                             displayEntity.IsSelected,
                                                             displayEntity.IsKey,
                                                             displayEntity.CurrentPrice,
                                                             displayEntity.NewPrice,
                                                             displayEntity.CurrentMarkupPercent,
                                                             displayEntity.NewMarkupPercent,
                                                             displayEntity.KeyValueChange,
                                                             displayEntity.InfluenceValueChange,
                                                             displayEntity.PriceChange,
                                                             displayEntity.PriceEdit.ToDto(),
                                                             displayEntity.PriceWarning.ToDto());

            return(dto);
        }