private void button2_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(textBox1.Text))
     {
         int brojac = int.Parse(textBox1.Text);
         var rand   = new Random();
         for (int i = 0; i < brojac; i++)
         {
             Thread.Sleep(100);
             var noviS = new StudentiPredmeti
             {
                 Student        = comboBox2.SelectedItem as Student,
                 Predmet        = _baza.Predmeti.ToList().ElementAt(rand.Next(1, 4)),
                 Ocjena         = rand.Next(5, 11),
                 DatumPolaganja = DateTime.Now,
             };
             _baza.StudentiPredmeti.Add(noviS);
             Action akcija = () => textBox2.Text += $"Za {comboBox2.SelectedItem as Student} dodat polozeni -> {noviS.Predmet.Naziv} ({noviS.Ocjena}) {Environment.NewLine}";
             BeginInvoke(akcija);
         }
         _baza.SaveChanges();
         UcitajPodatke();
         MessageBox.Show("Dodavanje predmeta završeno");
     }
 }
 public frmStudentSeminarskiIB200002(StudentiPredmeti student)
 {
     InitializeComponent();
     _student = student;
 }
 public frmStudentSlikeIB200002(StudentiPredmeti student)
 {
     InitializeComponent();
     _student = student;
 }