Beispiel #1
0
        private void btnMedieViitor_Click(object sender, EventArgs e)
        {
            if (txtNrMatricol.Text != "")
            {
                Studenti stud = studentRepository.GetAllStudents().Where(s => s.NrMatricol == Convert.ToInt32(txtNrMatricol.Text)).FirstOrDefault();
                if (stud != null)
                {
                    bool mediaCreste = PreziceriAlgo.PrezicereMedie(stud);

                    if (mediaCreste)
                    {
                        MessageBox.Show("Media pentru studentul cu Nr: " + stud.NrMatricol + " VA CRESTE");
                    }
                    else
                    {
                        MessageBox.Show("Media pentru studentul cu Nr: " + stud.NrMatricol + " VA SCADEA");
                    }
                }
                else
                {
                    MessageBox.Show("Nu s-a gasit un student cu nr matricol " + txtNrMatricol.Text);
                }
            }
            else
            {
                MessageBox.Show("Selectati un student din lista");
            }
        }
Beispiel #2
0
        private void btnPesteOpt_Click(object sender, EventArgs e)
        {
            int             nrStudenti = 0;
            List <Studenti> studenti   = studentRepository.GetAllStudents();

            if (studenti.Count > 0)
            {
                foreach (Studenti student in studenti)
                {
                    if (student.Medie >= 8)
                    {
                        bool mediaCreste = PreziceriAlgo.PrezicereMedie(student);
                        if (mediaCreste)
                        {
                            nrStudenti++;
                        }
                    }
                }

                MessageBox.Show("Din studentii cu media peste 8, " + nrStudenti + " vor avea media mai mare");
            }
            else
            {
                MessageBox.Show("Nu exista studenti");
            }
        }
Beispiel #3
0
        private void btnZiBuna_Click(object sender, EventArgs e)
        {
            if (txtNrMatricol.Text != "")
            {
                Studenti stud = studentRepository.GetAllStudents().Where(s => s.NrMatricol == Convert.ToInt32(txtNrMatricol.Text)).FirstOrDefault();
                if (stud != null)
                {
                    bool zibuna = PreziceriAlgo.PrezicereTipZi(stud);

                    if (zibuna)
                    {
                        MessageBox.Show("Studentul cu Nr: " + stud.NrMatricol + " VA AVEA O ZI BUNA");
                    }
                    else
                    {
                        MessageBox.Show("Studentul cu Nr: " + stud.NrMatricol + " NU VA AVEA O ZI BUNA");
                    }
                }
                else
                {
                    MessageBox.Show("Nu s-a gasit un student cu nr matricol " + txtNrMatricol.Text);
                }
            }
        }