Exemple #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);
        }
Exemple #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);
        }