예제 #1
0
        public static Display.AnalyticPriceListGroup ToDisplayEntity(this DTO.AnalyticPriceListGroup dto)
        {
            var displayEntity = new Display.AnalyticPriceListGroup();

            displayEntity.Key   = dto.Key;
            displayEntity.Name  = dto.Name;
            displayEntity.Title = dto.Title;
            displayEntity.Sort  = dto.Sort;

            if (dto.PriceLists != null)
            {
                dto.PriceLists.ForEach(item => displayEntity.PriceLists.Add(item.ToDisplayEntity()));
            }

            return(displayEntity);
        }
예제 #2
0
        public static DTO.AnalyticPriceListGroup ToDto(this Display.AnalyticPriceListGroup displayEntity)
        {
            List <DTO.PriceList> priceLists = new List <DTO.PriceList>();

            foreach (Display.PriceList priceList in displayEntity.PriceLists)
            {
                priceLists.Add(priceList.ToDto());
            }

            var dto = new DTO.AnalyticPriceListGroup(
                displayEntity.Key,
                displayEntity.Name,
                displayEntity.Title,
                displayEntity.Sort,
                priceLists);

            return(dto);
        }