private void buttonAnuleazaNota_Click(object sender, EventArgs e)
        {
            try
            {
                MedieSemestruBL med    = new MedieSemestruBL();
                NotaBL          notaBL = new NotaBL();
                int             idNota = int.Parse(comboBoxListaNote.SelectedValue.ToString());
                DataTable       m      = med.GetMedieSemIDuri(id_sem, id_elev, id_mat);
                int             medie  = 0;
                if (m != null)
                {
                    medie = int.Parse(m.Rows[0]["medie_semstru"].ToString());
                }

                if (medie == 0)
                {
                    notaBL.DeleteNota(idNota);
                    labelAnulareNota.Text = "Nota a fost stearsa cu succes!";
                }
                else
                {
                    labelAnulareNota.Text = "Nota nu poate fi stearsa pentru ca media e deja incheiata!";
                }
            }
            catch (Exception exc)
            {
                labelAnulareNota.Text = "Media pentru datele dumneavoasta nu figureaza in baza de date, nota nu poate fi stearsa!";
            }

            NotaBL    notaBl    = new NotaBL();
            DataTable listaNote = notaBl.GetNoteByIDuri(id_elev, id_mat, id_sem);
            NotaForm  nf        = new NotaForm();

            nf.setListaNote(listaNote);
        }
Пример #2
0
        private void buttonAddTezaForm_Click(object sender, EventArgs e)
        {
            int    teza   = int.Parse(textBoxAddTeza.Text);
            NotaBL notaBL = new NotaBL();

            if (teza != 0)
            {
                ClasaBL   cls       = new ClasaBL();
                DataTable verifTeza = cls.VerifTeza(materieID, clasaID);
                bool      areTeza   = bool.Parse(verifTeza.Rows[0]["teza"].ToString());
                if (areTeza)
                {
                    notaBL.AddTeza(elevID, materieID, semID, teza);
                    labelMsgAddTezaForm.Text = "Adaugare teza cu succes!";
                }
                else
                {
                    labelMsgAddTezaForm.Text = "Materia selectat nu are teza la acesta clasa!";
                }
            }
            else
            {
                labelMsgAddTezaForm.Text = "Adaugare esuta, camp incomplet!";
            }
        }
        private void ListaNote()
        {
            NotaBL notaBL = new NotaBL();

            comboBoxListaNote.DisplayMember = "nota";
            comboBoxListaNote.ValueMember   = "id_nota";
            comboBoxListaNote.DataSource    = notaBL.GetNoteByIDuri(id_elev, id_mat, id_sem);
        }
Пример #4
0
        private void buttonAnulareNota_Click(object sender, EventArgs e)
        {
            NotaBL          notaBl    = new NotaBL();
            int             semID     = int.Parse(comboBoxNotaSem.SelectedValue.ToString());
            int             elevID    = int.Parse(comboBoxNotaElev.SelectedValue.ToString());
            int             materieID = int.Parse(comboBoxNotaMaterie.SelectedValue.ToString());
            AnulareNotaForm anulN     = new AnulareNotaForm(semID, elevID, materieID);

            anulN.ShowDialog();
            anulN.Dispose();
        }
Пример #5
0
        private void CalcMediePeSem_Click(object sender, EventArgs e)
        {
//             try
//             {
            int       semID     = int.Parse(comboBoxNotaSem.SelectedValue.ToString());
            int       elevID    = int.Parse(comboBoxNotaElev.SelectedValue.ToString());
            int       materieID = int.Parse(comboBoxNotaMaterie.SelectedValue.ToString());
            int       clasaId   = int.Parse(comboBoxNotaClasa.SelectedValue.ToString());
            NotaBL    notBL     = new NotaBL();
            ClasaBL   clBl      = new ClasaBL();
            DataTable t         = clBl.VerifTeza(materieID, clasaId);
            bool      tezica    = bool.Parse(t.Rows[0]["teza"].ToString());
            DataTable note      = notBL.GetNoteByIDuri1(elevID, materieID, semID);

            if (note.Rows.Count >= 3)
            {
                int medie = 0;
                int teza  = 0;
                for (int i = 0; i < note.Rows.Count; i++)
                {
                    //if (note.Rows.Rows[i]["nota"] != null)
                    medie = medie + int.Parse(note.Rows[i]["nota"].ToString());
                }
                //else
                //teza = int.Parse(note.Rows.Rows[i]["teza"].ToString());
                medie = medie / note.Rows.Count;
                if (tezica)
                {
                    t     = notBL.GetTezaByIDuri(elevID, materieID, semID);
                    teza  = int.Parse(t.Rows[0]["teza"].ToString());
                    medie = (medie * 3 + teza) / 4;
                }



                MedieSemestruBL mdsem = new MedieSemestruBL();
                mdsem.AddMedie(elevID, materieID, semID, medie);
                labelEroareNotaForm.Text = "Media este: " + medie.ToString();
            }
            else
            {
                labelEroareNotaForm.Text = "Media nu poate fi calculata deoarece nu sunt minim 3 note!";
            }



            //}
            //  catch(Exception except)
            // {
            //     labelEroareNotaForm.Text = "eroare";
            // }
        }
Пример #6
0
        private void buttonNotaVizualizare_Click(object sender, EventArgs e)
        {
            int    semID     = int.Parse(comboBoxNotaSem.SelectedValue.ToString());
            int    elevID    = int.Parse(comboBoxNotaElev.SelectedValue.ToString());
            int    materieID = int.Parse(comboBoxNotaMaterie.SelectedValue.ToString());
            NotaBL notaBl    = new NotaBL();

            listaNote = notaBl.GetNoteByIDuri(elevID, materieID, semID);
            VizualizareNote notviz = new VizualizareNote(listaNote);

            notviz.ShowDialog();
            notviz.Dispose();
        }
        private void buttonAddAbsForm_Click(object sender, EventArgs e)
        {
            int nota = int.Parse(textBoxAddNota.Text);

            NotaBL notaBL = new NotaBL();

            if (nota != 0)
            {
                notaBL.AddNota(elevID, materieID, semID, nota);
                labelMsgAddNotaForm.Text = "Adaugare nota cu succes!";
            }
            else
            {
                labelMsgAddNotaForm.Text = "Adaugare esuta, camp incomplet!";
            }
        }