private void btnVerwijderLid_Click(object sender, EventArgs e)
 {
     if (lbLeden.SelectedItem == null)
     {
         MessageBox.Show("Selecteer een lid uit de lijst");
         lbLeden.Focus();
         return;
     }
     if (lbLeden.SelectedItem is Lid)
     {
         Lid lid = lbLeden.SelectedItem as Lid;
         bioscoop.VerwijderPersoon(lid);
         refreshData();
     }
 }
Exemple #2
0
 private void btnRegistreer_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtNaam.Text))
     {
         MessageBox.Show("Vul een naam in");
         txtNaam.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtAdres.Text))
     {
         MessageBox.Show("Vul een adres in");
         txtAdres.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtWoonplaats.Text))
     {
         MessageBox.Show("Vul een woonplaats in");
         txtWoonplaats.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtGebruikersnaam.Text))
     {
         MessageBox.Show("Vul een gebruikersnaam in");
         txtGebruikersnaam.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtWachtwoord.Text))
     {
         MessageBox.Show("Vul een wachtwoord in");
         txtWachtwoord.Focus();
         return;
     }
     if (chbVoorwaarde.Checked)
     {
         string   Naam           = txtNaam.Text;
         string   Adres          = txtAdres.Text;
         string   Woonplaats     = txtWoonplaats.Text;
         DateTime Geboortedatum  = dtpGeboortedatum.Value;
         string   Gebruikersnaam = txtGebruikersnaam.Text;
         string   Wachtwoord     = txtWachtwoord.Text;
         Lid      NieuwLid       = new Lid(Naam, Adres, Woonplaats, Geboortedatum, Gebruikersnaam, Wachtwoord);
         bioscoop.VoegPersoonToe(NieuwLid);
         this.Close();
     }
 }
Exemple #3
0
 public Lid LogInLid(string gebruikersnaam, string wachtwoord)
 {
     foreach (Persoon p in Personen)
     {
         if (p is Lid)
         {
             Lid l = p as Lid;
             if (l.Gebruikersnaam == gebruikersnaam)
             {
                 if (l.WachtwoordCorrect(wachtwoord))
                 {
                     return(l);
                 }
             }
         }
     }
     return(null);
 }
Exemple #4
0
        public void MaakStandaardBioscoop()
        {
            //Maak zalen
            BouwZaal(new Zaal(1, Bioscoopvertoning.Filmkwaliteit._2D, 12, 25, 2, 15));
            BouwZaal(new Zaal(2, Bioscoopvertoning.Filmkwaliteit._3D, 15, 25, 3, 10));
            BouwZaal(new Zaal(3, Bioscoopvertoning.Filmkwaliteit._Imax_3D, 20, 30, 5, 20));
            BouwZaal(new Zaal(4, Bioscoopvertoning.Filmkwaliteit._Imax_3D, 20, 30, 5, 20));
            BouwZaal(new Zaal(5, Bioscoopvertoning.Filmkwaliteit._Imax_2D, 15, 22, 4, 10));

            //Maak films
            for (int i = 0; i < 20; i++)
            {
                Film film = new Film("Film" + i, 2018, 2, "Engels", 16, null);
                VoegFilmToe(new Bioscoopvertoning(film, DateTime.Now.AddHours(i), (Bioscoopvertoning.Filmkwaliteit)(i % 4), Zalen[i % 5], i));
                VoegFilmToe(new DigitaleKopie(film, i * 123, i));
            }

            //Maak personen
            for (int i = 0; i < 50; i++)
            {
                VoegPersoonToe(new Medewerker("Medewerker", "Straat 15", "Plaats", new DateTime(1, 1, 1), i, "1234"));
            }

            for (int i = 0; i < 100; i++)
            {
                Lid NieuwLid = new Lid("Lid", "Straat 15", "Plaats", new DateTime(1, 1, 1), "Gebruikersnaam", "1234");
                for (int j = 0; j < i % 3; j++)
                {
                    Bestelling NieuweBestelling = new Bestelling(NieuwLid, Vertoningen[(i * j) % 20], Vertoningen[(i * j) % 20].BioscoopZaal.Stoelen[i % Vertoningen[(i * j) % 20].BioscoopZaal.Stoelen.Count]);
                    Uitlening  NieuweUitlening  = new Uitlening(DateTime.Now.AddDays(j), DateTime.Now.AddDays(j + 3), DigitaleKopieen[i % 20], NieuwLid);
                }
                VoegPersoonToe(NieuwLid);
            }

            for (int i = 0; i < 200; i++)
            {
                Bezoeker   NieuweBezoeker   = new Bezoeker("Bezoeker", "Straat 15", "Plaats", new DateTime(1, 1, 1));
                Bestelling NieuweBestelling = new Bestelling(NieuweBezoeker, Vertoningen[i % 20], Vertoningen[i % 20].BioscoopZaal.Stoelen[i % Vertoningen[i % 20].BioscoopZaal.Stoelen.Count]);
                VoegPersoonToe(NieuweBezoeker);
            }
        }
 private void btnLogIn_Click(object sender, EventArgs e)
 {
     if (txtGebruiker.Text != null && txtWW.Text != null)
     {
         if (rbLid.Checked)
         {
             Lid l = Bios.LogInLid(txtGebruiker.Text, txtWW.Text);
             if (l != null)
             {
                 formLeden lid = new formLeden(Bios, l);
                 lid.Show();
             }
             else
             {
                 MessageBox.Show("Inloggegevens onjuist");
             }
         }
         else if (rbMedewerker.Checked)
         {
             try
             {
                 Medewerker m = Bios.LogInMedewerker(Convert.ToInt32(txtGebruiker.Text), txtWW.Text);
                 if (m != null)
                 {
                     formMedewerker medewerker = new formMedewerker(m, Bios);
                     medewerker.Show();
                 }
                 else
                 {
                     MessageBox.Show("Inloggegevens onjuist");
                 }
             }
             catch (FormatException)
             {
                 MessageBox.Show("Inloggegevens onjuist");
             }
         }
     }
 }