private void LeesSessieGegevens() { SessieDataService sessieDs = new SessieDataService(); Sessies = new ObservableCollection <Sessie>(sessieDs.GetSessies()); //Pionnen = new ObservableCollection<Pion>(pionDs.GetPionnen()); BordDataService bordDs = new BordDataService(); Borden = new ObservableCollection <Bord>(bordDs.GetBorden()); RecentsteSessie = Sessies.LastOrDefault(); foreach (Bord bord in Borden) { if (bord.ID == RecentsteSessie.bordID) { hexBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(bord.HexCode)); } } }
public void LeesBorden() { //instantiëren dataservice BordDataService bordDS = new BordDataService(); Borden = new ObservableCollection <Bord>(bordDS.GetBorden()); }
public void WijzigenBord() { if (CurrentBord != null) { BordDataService bordDS = new BordDataService(); bordDS.UpdateBord(CurrentBord); //Refresh LeesBorden(); } }
public void ToevoegenBord() { BordDataService bordDS = new BordDataService(); bordDS.ToevoegenBord(CurrentBord); Messenger.Default.Send <BordUpdatedMessage>(new BordUpdatedMessage()); //Refresh LeesBorden(); }
//public void ReferentieControle(Bord ClickedBord) //{ // foreach (var item in Sessies) // { // if (item.bordID.Equals(ClickedBord.ID)) // { // isReferencedOrNot ++; // } // } //} public void VerwijderenBord() { //ReferentieControle(CurrentBord); try { Messenger.Default.Send <Bord>(CurrentBord); BordDataService bordDS = new BordDataService(); bordDS.DeleteBord(CurrentBord); //Messenger.Default.Send<Bord>(CurrentBord); //Refresh LeesBorden(); } catch (Exception sqlEx) { MessageBox.Show("Bord wordt in een sessie gerefereerd, kan niet gedelete worden."); } //if (isReferencedOrNot != 0) //{ //} else //{ // Messenger.Default.Send<Bord>(CurrentBord); // BordDataService bordDS = // new BordDataService(); // bordDS.DeleteBord(CurrentBord); // //Messenger.Default.Send<Bord>(CurrentBord); // //Refresh // LeesBorden(); //} }
public void RefreshBorden() { BordDataService bordenDs = new BordDataService(); Borden = new ObservableCollection <Bord>(bordenDs.GetBorden()); }