Beispiel #1
0
 private void DataGridView1_SelectionChanged(object sender, EventArgs e)
 {
     Data.Catalogus.resetBoekenSelectie();
     foreach (DataGridViewRow row in dataGridView1.SelectedRows)
     {
         Data.Boek boekSelected = (Data.Boek)row.DataBoundItem;
         Data.Catalogus.addBoekenSelectie(boekSelected);
     }
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int tempDeel;
            Dictionary <string, string> errorMessages = new Dictionary <string, string>();

            Data.Boek boek;
            if (int.TryParse(txtDeel.Text, out tempDeel))
            {
                boek = new Data.Boek(Data.Catalogus.getBoeken().Count + 1, txtTitel.Text, txtSubtitel.Text, txtAuteur.Text, tempDeel);
            }
            else
            {
                boek = new Data.Boek(Data.Catalogus.getBoeken().Count + 1, txtTitel.Text, txtSubtitel.Text, txtAuteur.Text, 1);
            }

            errorMessages = boek.validate();

            Label[] textCheckers = new Label[] { lblTitelException, lblSubtitelException, lblAuteurException, lblDeelException };

            foreach (Label label in textCheckers)
            {
                label.ResetText();
            }

            if (errorMessages.Count == 0)
            {
                List <Data.Boek> duplicates = Data.Catalogus.getDuplicates(boek);
                if (!showDuplicateDialog(duplicates))
                {
                    Data.Catalogus.addBoek(boek);
                    Data.Catalogus.setBufferOnopgeslagen(true);
                }
            }
            else
            {
                showErrors(errorMessages);
            }
        }
Beispiel #3
0
 public Wijzig_Boek(Data.Boek boek)
 {
     InitializeComponent();
     this.boek = boek;
 }