//gekozen lijst ontvangen private void OnLijstReceived(Lijsten lijst) { BierDataService ds = new BierDataService(); Biertjes = ds.GetBiertjes(); SelectedLijst = lijst; lijstNaam = lijst.Naam; //connectie tussen bieren en lijsten via BierInLijst BierenInLijst = ds.GetBierInLijstByLijstId(SelectedLijst.Id); //lijst van bierIds List <int> bierIdsList = new List <int>(); foreach (BierInLijst BierInLijst in BierenInLijst) { bierIdsList.Add(BierInLijst.BierId); } if (bierIdsList.Any()) { string bierIds = string.Join(",", bierIdsList.ToArray()); //bieren ophalen BiertjesInLijst = ds.GetBiertjesInLijst(bierIds); } else { BiertjesInLijst = new ObservableCollection <Biertjes>(); } }
//bieren in lijsten herladen private void BiertjesInLijstHerladen() { BierDataService ds = new BierDataService(); //connectie tussen bieren en lijsten via BierInLijst BierenInLijst = ds.GetBierInLijstByLijstId(SelectedLijst.Id); //lijst van bierIds List <int> bierIdsList = new List <int>(); foreach (BierInLijst BierInLijst in BierenInLijst) { bierIdsList.Add(BierInLijst.BierId); } if (bierIdsList.Any()) { string bierIds = string.Join(",", bierIdsList.ToArray()); //bieren ophalen BiertjesInLijst = ds.GetBiertjesInLijst(bierIds); } }