Example #1
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!";
            }
        }
Example #2
0
        private void buttonAsocProfMatClasaUp_Click(object sender, EventArgs e)
        {
            //ProfesorBL profBL = new ProfesorBL();
            //MaterieBL matBL = new MaterieBL();
            ClasaBL clasaBL    = new ClasaBL();
            int     profesorID = int.Parse(comboBoxProfiAsocPMCUp.SelectedValue.ToString());
            int     materieID  = int.Parse(comboBoxMateriiAsocPMCUp.SelectedValue.ToString());
            int     clasaID    = int.Parse(comboBoxClaseAsocPMCUp.SelectedValue.ToString());
            bool    teza       = bool.Parse(textBoxTezaAsocPMCUp.Text);

            int profIDNew = int.Parse(comboBoxProfiAsocPMCUpNew.SelectedValue.ToString());

            DataTable id = clasaBL.GetIdForProfMaterieClasaTeza(profesorID, materieID, clasaID, teza);

            int  prof_clasaID = 0;
            bool ok           = false;

            for (int i = 0; i < id.Rows.Count; i++)
            {
                if (id.Rows[i] != null)
                {
                    prof_clasaID = int.Parse(id.Rows[i][id.Columns[0]].ToString());
                    ok           = true;
                }
            }
            if (ok)
            {
                clasaBL.UpdateAsocProfesorClasa(prof_clasaID, profIDNew);
                labelMsgAsocPMCUp.Text = "Actualizarea a fost realizata cu succes!";
            }
            else
            {
                labelMsgAsocPMCUp.Text = "Actualizare esuata. Asocierea initiala nu exista!";
            }
        }
Example #3
0
        private void ListClasa()
        {
            ClasaBL clasaBL = new ClasaBL();

            comboBoxDeleteClasa.DisplayMember = "nume_clasa";
            comboBoxDeleteClasa.ValueMember   = "id_clasa";
            comboBoxDeleteClasa.DataSource    = clasaBL.GetClase();
        }
Example #4
0
        private void PopulateUpdateControls()
        {
            int       clasaID = int.Parse(comboBoxClasaUpdate.SelectedValue.ToString());
            ClasaBL   clasaBL = new ClasaBL();
            DataTable ds      = clasaBL.GetClasaById(clasaID);

            textBoxNumeClasa.Text = ds.Rows[0]["nume_clasa"].ToString();
        }
Example #5
0
        private void buttonAsociereClasaDirig_Click(object sender, EventArgs e)
        {
            int     clasaID = int.Parse(comboBoxClaseAsoc.SelectedValue.ToString());
            int     profID  = int.Parse(comboBoxProfiAsoc.SelectedValue.ToString());
            ClasaBL clasaBL = new ClasaBL();

            clasaBL.AsocDiriginteClasa(profID, clasaID);
        }
Example #6
0
        private void buttonAsociereClasaAnStudiu_Click(object sender, EventArgs e)
        {
            int     clasaID     = int.Parse(comboBoxClaseAsoc.SelectedValue.ToString());
            int     an_studiuID = int.Parse(comboBoxAnStudiuAsoc.SelectedValue.ToString());
            ClasaBL clasaBL     = new ClasaBL();

            clasaBL.AsocAn_StudiuClasa(an_studiuID, clasaID);
        }
        private void buttonAsocProfMatClasa_Click(object sender, EventArgs e)
        {
            int     profID    = int.Parse(comboBoxProfiAsocPMC.SelectedValue.ToString());
            int     materieID = int.Parse(comboBoxMateriiAsocPMC.SelectedValue.ToString());
            int     clasaID   = int.Parse(comboBoxClaseAsocPMC.SelectedValue.ToString());
            bool    teza      = bool.Parse(textBoxTezaAsocPMC.Text);
            ClasaBL clasaBL   = new ClasaBL();

            clasaBL.AsocProfesorClasa(profID, materieID, clasaID, teza);
            labelMsgAsocPMC.Text = "Asociere reusita!";
        }
Example #8
0
        private void buttonDeleteClasa_Click(object sender, EventArgs e)
        {
            int clasaID = int.Parse(comboBoxDeleteClasa.SelectedValue.ToString());

            if (MessageBox.Show("Sigur vreti sa stergeti clasa?", "Intrebare", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ClasaBL clasaBL = new ClasaBL();
                clasaBL.DeleteClasa(clasaID);
                labelDeleteClasa.Text = "Stergerea a fost realizata cu succes! ";
            }
            ListClasa();
        }
Example #9
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";
            // }
        }
Example #10
0
        private void ListClasa()
        {
            int materieID = int.Parse(comboBoxNotaMaterie.SelectedValue.ToString());

            try
            {
                ClasaBL clasaBL = new ClasaBL();
                comboBoxNotaClasa.DisplayMember = "nume_clasa";
                comboBoxNotaClasa.ValueMember   = "id_clasa";
                comboBoxNotaClasa.DataSource    = clasaBL.GetClasaByProfMatId(id_prof_logat, materieID).Rows;
            }
            catch (Exception e)
            {
                labelEroareNotaForm.Text = "Profesorul nu are clase asociate materiei!";
            }
        }
Example #11
0
        private void ButtonUpdateProf_Click(object sender, EventArgs e)
        {
            string nume = textBoxNumeClasa.Text;

            ClasaBL clasaBL = new ClasaBL();

            if (!string.IsNullOrWhiteSpace(nume))
            {
                int clasaID = int.Parse(comboBoxClasaUpdate.SelectedValue.ToString());
                clasaBL.UpdateClasa(clasaID, nume);
                labelMsgUpdateClasa.Text = "Actualizarea a fost realizata cu succes! ";
            }
            else
            {
                labelMsgUpdateClasa.Text = "Date incomplete ! ";
            }
            ListClasa();
        }
        private void buttonAddClasa_Click(object sender, EventArgs e)
        {
            string nume = textBoxClasaNume.Text;

            ClasaBL clasaBL = new ClasaBL();

            if (!string.IsNullOrWhiteSpace(nume))
            {
                clasaBL.AddClasa(nume);
                labelMsgAddClasa.Text = "Adaugare cu succes! ";

                textBoxClasaNume.Text = "";
            }
            else
            {
                labelMsgAddClasa.Text = "Date incomplete ! ";
            }
        }