Beispiel #1
0
        public static VestigingModel Parse(OptionParseVestigingModels option)
        {
            var vestiging = new VestigingModel
            {
                Id                    = option.vestigingEntity.Id,
                Adres                 = option.incAdres ? AdresModel.Parse(option.vestigingEntity.Adre, option.currentLocation) : null,
                Destination           = BestemmingModel.Parse(option.vestigingEntity.Destination, option.currentLocation),
                Latitude              = option.vestigingEntity.Latitude,
                Longtitude            = option.vestigingEntity.Longtitude,
                Naam                  = option.vestigingEntity.Naam,
                Pakkets               = option.incPakketten ? PakketModel.Parse(option.vestigingEntity.Pakkets) : null,
                ZoomLevel             = option.vestigingEntity.ZoomLevel,
                Korting               = option.vestigingEntity.Korting,
                Tax                   = option.vestigingEntity.Tax,
                Status                = option.vestigingEntity.Status,
                Valuta                = ValutaModel.Parse(option.vestigingEntity.Valuta),
                Leverancier           = option.incLeverancier ? LeverancierModel.Parse(option.vestigingEntity.Leverancier, option.currentLocation, false) : null,
                ExternalId            = option.vestigingEntity.ExternalId,
                VestigingOpeningHours = option.incVestigingOpeningHour ? VestigingOpeningHourModel.Parse(option.vestigingEntity.VestigingOpeningHours) : null,
                UrlNameParent         = option.destinations.FirstOrDefault(l => l.Id == option.vestigingEntity.Destination.ParentId) != null
                                ? option.destinations.FirstOrDefault(l => l.Id == option.vestigingEntity.Destination.ParentId).DisplayName
                                : string.Empty,
                UrlName = option.destinations.FirstOrDefault(l => l.Cities.Any(c => c.Id == option.vestigingEntity.Destination.Id)) != null
                                ? option.destinations.FirstOrDefault(l => l.Cities.Any(c => c.Id == option.vestigingEntity.Destination.Id)).Cities.First(x => x.Id == option.vestigingEntity.Destination.Id).DisplayName
                                : string.Empty,
            };

            if (option.useLocalCurrency)
            {
                UpdateLocalPackagesUsingLocalCurrency(vestiging);
            }

            return(vestiging);
        }
Beispiel #2
0
        public static AdresModel Parse(Adre adresEntity, string currentLocation)
        {
            var adres = new AdresModel
            {
                Id        = adresEntity.Id,
                Faxnummer = adresEntity.Faxnummer,
                Land      = adresEntity.Destination != null?BestemmingModel.Parse(adresEntity.Destination, currentLocation) : new BestemmingModel(),
                                Mobielnummer   = adresEntity.Mobielnummer,
                                Plaats         = adresEntity.Plaats,
                                Postcode       = adresEntity.Postcode,
                                Straat         = adresEntity.Straat,
                                Huisnummer     = adresEntity.Huisnummer,
                                Telefoonnummer = adresEntity.Telefoonnummer,
            };

            return(adres);
        }
        public static BestemmingModel Parse(Destination bestemmingEntity, string currentLocation, Language.Languages language = Language.Languages.Dutch)
        {
            var content = bestemmingEntity.Contents.Where(c => c.LanguageId == (int)language).SingleOrDefault()
                          ?? bestemmingEntity.Contents.Where(c => c.LanguageId == (int)Language.Languages.Dutch).SingleOrDefault()
                          ?? bestemmingEntity.Contents.FirstOrDefault();

            var bestemming = new BestemmingModel
            {
                BxName          = "",
                DestinationType = bestemmingEntity.TypeId,
                Fastcheck       = false,
                Id                   = bestemmingEntity.Id,
                ParentId             = bestemmingEntity.ParentId,
                ImageCounter         = 0,
                IsActive             = bestemmingEntity.Status,
                IsoCode              = "",
                Latitude             = bestemmingEntity.Contents.First().Latitude,
                Longitude            = bestemmingEntity.Contents.First().Longitude,
                SeoName              = content != null ? content.DisplayName : "",
                TradeTrackerTopXml   = false,
                TradeTrackerXml      = false,
                UrlName              = content != null ? content.UrlName : "",
                WeerOnlineCountryID  = 0,
                WeerOnlineRegionID   = 0,
                WtcDesID             = 0,
                WtcHcID              = 0,
                WtcHoID              = 0,
                WtcVtID              = 0,
                ZoomLevel            = bestemmingEntity.Contents.First().ZoomLevel,
                Feestdagen           = "",
                Hotels               = "",
                EmailAdresReisburoId = "",
                CurrentDestination   = content.UrlName == currentLocation
            };

            return(bestemming);
        }