Exemple #1
0
        private void AddCheckin(Checkin checkin, CheckinsContainer checkinsContainer)
        {
            Beer beer = checkinsContainer.GetBeer(checkin.Beer.Id);

            if (beer == null)
            {
                beer = checkin.Beer;
                Brewery brewery = checkinsContainer.GetBrewery(beer.Brewery.Id);
                if (brewery == null)
                {
                    brewery = beer.Brewery;
                    Venue venue = brewery.Venue;
                    if (IsUpdateVenue(ref venue, checkinsContainer))
                    {
                        brewery.Venue = venue;
                    }

                    checkinsContainer.AddBrewery(brewery);
                }
                else
                {
                    beer.Brewery = brewery;
                }
                checkinsContainer.AddBeer(beer);
            }
            else
            {
                checkin.Beer = beer;
            }

            FillCheckinVenue(checkin, checkinsContainer);
            checkinsContainer.AddCheckin(checkin);
        }
Exemple #2
0
 private static void FillBrewery(Brewery brewery, BreweryWeb breweryWeb)
 {
     brewery.Id              = breweryWeb.BreweryId;
     brewery.Name            = breweryWeb.BreweryName;
     brewery.Url             = $"{UriConstants.BaseUri}brewery/{breweryWeb.BreweryId}";
     brewery.Venue.Country   = breweryWeb.CountryName;
     brewery.Venue.City      = breweryWeb.Location.BreweryCity;
     brewery.Venue.State     = breweryWeb.Location.BreweryState;
     brewery.Venue.Latitude  = breweryWeb.Location.Lat;
     brewery.Venue.Longitude = breweryWeb.Location.Lng;
     brewery.LabelUrl        = breweryWeb.BreweryLabel.ToString();
 }
Exemple #3
0
 public Beer()
 {
     Brewery = new Brewery();
 }
 public void AddBrewery(Brewery brewery)
 {
     brewerys.Add(brewery);
     IsСhanges = true;
 }