Esempio n. 1
0
        private void btnEditAuteurs_Click(object sender, EventArgs e)
        {
            EditAuteurList editAuteurList = new EditAuteurList();

            editAuteurList.boekenLijst.Clear();
            using (BibliotheekEntities ctx = new BibliotheekEntities())
            {
                Boeken boek = ctx.Boekens.Where(s => s.Id == selectedID).FirstOrDefault();
                editAuteurList.boekenLijst.Add(boek.Id, boek.Titel);
            }
            editAuteurList.ShowDialog();
            laadboek();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (BibliotheekEntities ctx = new BibliotheekEntities())
            {
                switch (cbxTables.SelectedItem)
                {
                case "Auteur":
                    AuteurForm nieuweAuteur = new AuteurForm();
                    nieuweAuteur.selectedID = (int)lbxVieuw.SelectedValue;
                    nieuweAuteur.ShowDialog();
                    break;

                case "Uitgeverijen":
                    UitgeverijenForm uitgeverijenForm = new UitgeverijenForm();
                    uitgeverijenForm.selectedID = (int)lbxVieuw.SelectedValue;
                    uitgeverijenForm.ShowDialog();
                    break;

                case "Genre":
                    GenreForm genreForm = new GenreForm();
                    genreForm.selectedID = (int)lbxVieuw.SelectedValue;
                    genreForm.ShowDialog();
                    break;

                case "BoekenAuteur":
                    EditAuteurList ea = new EditAuteurList();
                    foreach (var item in ctx.Boekens.Select(s => s))
                    {
                        ea.boekenLijst.Add(item.Id, item.Titel);
                    }
                    ea.ShowDialog();
                    break;

                case "BoekenGenre":
                    EditGenreList eg = new EditGenreList();
                    foreach (var item in ctx.Boekens.Select(s => s))
                    {
                        eg.boekenLijst.Add(item.Id, item.Titel);
                    }
                    eg.ShowDialog();
                    break;

                default:
                    BoekForm boekform = new BoekForm();
                    boekform.selectedID = (int)lbxVieuw.SelectedValue;
                    boekform.ShowDialog();
                    break;
                }
                LaadList();
            }
        }