Exemplo n.º 1
0
        public void Load_Analytic()
        {
            var id       = new ENTITY.Analytic(3);
            var response = AnalyticClient.Load(new ENTITY.Session <ENTITY.Analytic>()
            {
                Data = id
            });                                                                                      //TODO: new with constructor id

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Data);
        }
Exemplo n.º 2
0
        public void LoadAnalyticFilters()
        {
            var id = new ENTITY.Analytic(3);

            var response = AnalyticClient.LoadFilters(new ENTITY.Session <ENTITY.Analytic>()
            {
                Data = id
            });

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Data);
        }
        public List <AnalyticValueDriver> LoadDrivers(Analytic displayAnalytic)
        {
            DTO.Analytic payload    = displayAnalytic.ToDto();
            var          sessionDto = new DTO.Session <DTO.Analytic> {
                Data = payload
            };

            DTO.Session <DTO.Analytic> response = null;//TODO: set to null until AnalyticService contract is updated. _analyticService.LoadDrivers(sessionDto);

            var displayList = new List <AnalyticValueDriver>();

            foreach (var driver in response.Data.ValueDrivers)
            {
                displayList.Add(driver.ToDisplayEntity());
            }

            return(displayList);
        }
        public List <FilterGroup> LoadFilterGroups(Analytic displayAnalytic)
        {
            DTO.Analytic payload    = displayAnalytic.ToDto();
            var          sessionDto = new DTO.Session <DTO.Analytic> {
                Data = payload
            };

            DTO.Session <DTO.Analytic> response = null;//TODO: set to null until AnalyticService contract is updated. _analyticService.LoadFilters(sessionDto);

            var displayList = new List <FilterGroup>();

            foreach (DTO.FilterGroup filterGroup in response.Data.FilterGroups)
            {
                displayList.Add(filterGroup.ToDisplayEntity());
            }

            return(displayList);
        }
        public List <AnalyticPriceListGroup> LoadPriceListGroupss(Analytic displayAnalytic)
        {
            DTO.Analytic payload    = displayAnalytic.ToDto();
            var          sessionDto = new DTO.Session <DTO.Analytic> {
                Data = payload
            };

            DTO.Session <DTO.Analytic> returnedSession = null;

            //TODO: set to null until AnalyticService contract is updated. _analyticService.LoadDrivers(sessionDto);

            var displayList = new List <AnalyticPriceListGroup>();

            foreach (var group in returnedSession.Data.PriceListGroups)
            {
                displayList.Add(group.ToDisplayEntity());
            }

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

            displayEntity.SearchGroupKey = dto.SearchGroupKey;
            displayEntity.SearchGroupId  = dto.SearchGroupId;
            displayEntity.Id             = dto.Id;

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

            if (dto.FilterGroups != null)
            {
                foreach (DTO.FilterGroup filterGroup in dto.FilterGroups)
                {
                    displayEntity.FilterGroups.Add(filterGroup.ToDisplayEntity());
                }
            }

            if (dto.ValueDrivers != null)
            {
                foreach (DTO.AnalyticValueDriver driver in dto.ValueDrivers)
                {
                    displayEntity.ValueDrivers.Add(driver.ToDisplayEntity());
                }
            }

            if (dto.PriceListGroups != null)
            {
                foreach (DTO.AnalyticPriceListGroup priceListGroup in dto.PriceListGroups)
                {
                    displayEntity.PriceListGroups.Add(priceListGroup.ToDisplayEntity());
                }
            }

            displayEntity.IsDirty = false;

            return(displayEntity);
        }
Exemplo n.º 7
0
        public static DTO.Analytic ToDto(this Display.Analytic displayEntity)
        {
            DTO.AnalyticIdentity identity = displayEntity.Identity.ToDto();

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

            foreach (Display.FilterGroup filterGroup in displayEntity.FilterGroups)
            {
                filterGroups.Add(filterGroup.ToDto());
            }

            var drivers = new List <DTO.AnalyticValueDriver>();

            foreach (Display.AnalyticValueDriver driver in displayEntity.ValueDrivers)
            {
                drivers.Add(driver.ToDto());
            }

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

            foreach (Display.AnalyticPriceListGroup priceListGroup in displayEntity.PriceListGroups)
            {
                priceListGroups.Add(priceListGroup.ToDto());
            }

            var dto = new DTO.Analytic(
                displayEntity.Id,
                displayEntity.SearchId,
                displayEntity.SearchGroupKey,
                identity,
                drivers,
                priceListGroups,
                filterGroups);

            return(dto);
        }