Beispiel #1
0
        public PointOfInterest(IMajaEntity entity)
        {
            TappedCommand = new Command(() => MessagingCenter.Send(this, TappedMessage));
            object obj;

            Id   = entity.Id;
            Name = entity.Name;
            if (entity.DisplayAttributes.TryGetValue("level", out obj))
            {
                Level = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("rating", out obj) && obj != null)
            {
                Rating = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("rating_local", out obj) && obj != null)
            {
                RatingLocal = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("lat", out obj) && obj != null)
            {
                Latitude = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("lng", out obj) && obj != null)
            {
                Longitude = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("name_suffix", out obj))
            {
                NameSuffix = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("url", out obj))
            {
                Url = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("original_name", out obj))
            {
                OriginalName = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("marker", out obj))
            {
                Marker = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("perex", out obj))
            {
                Perex = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("thumbnail_url", out obj))
            {
                Image = (string)obj;
            }
        }
Beispiel #2
0
        public ImmoObject(IMajaEntity entity)
        {
            object obj;

            if (entity.DisplayAttributes.TryGetValue("OBJEKTTITEL", out obj))
            {
                Name = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("ID", out obj))
            {
                Id = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("ANBIETERNR", out obj))
            {
                VendorId = (string)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("PRICE", out obj) && obj != null)
            {
                Price = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("KAUFPREIS", out obj) && obj != null)
            {
                var price = (double)obj;
                if (price == 0)
                {
                    PurchasePrice = "Preis auf Anfrage";
                }
                else
                {
                    PurchasePrice = string.Format("{0:N0} €", price);
                }
            }
            if (entity.DisplayAttributes.TryGetValue("KALTMIETE", out obj) && obj != null)
            {
                ColdRent = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("NETTOKALTMIETE", out obj) && obj != null)
            {
                NetColdRent = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("WARMMIETE", out obj) && obj != null)
            {
                WarmRent = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("ANZAHL_ZIMMER", out obj) && obj != null)
            {
                Rooms = Convert.ToInt32(obj);
            }
            if (entity.DisplayAttributes.TryGetValue("WOHNFLAECHE", out obj) && obj != null)
            {
                LivingSpace = (double)obj;
            }
            if (entity.DisplayAttributes.TryGetValue("PREVIEWIMAGE", out obj))
            {
                if (!string.IsNullOrEmpty((string)obj))
                {
                    Image = "http:" + (string)obj;
                }
            }
            if (entity.DisplayAttributes.TryGetValue("GEO_ORT", out obj))
            {
                City = (string)obj;
            }
        }