Пример #1
0
        private void bunifuFlatButton7_Click(object sender, EventArgs e)
        {
            rdn.Visible = false;
            foreach (MaterialSkin.Controls.MaterialRadioButton b in Matieres_b)
            {
                this.panel1.Controls.Remove(b);
            }
            if (dgv_eleves.SelectedRows.Count == 1)
            {
                chart C = new chart(chart_e, this.id);
                //chart_e.DataManipulator.Statistics.Median.

                Eleve eleve = el[dgv_eleves.SelectedRows[0].Index];

                foreach (Matiere m in this.matieres)
                {
                    C.addChartEvolutionSeries(eleve, m);
                }
                Matieres_bs = C.series_bs;
                int y = chart_e.Location.Y;
                foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
                {
                    b.Location = new Point(chart_e.Location.X + chart_e.Width + 10, y);
                    b.Parent   = panel1;
                    y         += 25;
                    b.Show();
                }
            }
        }
Пример #2
0
        private void bunifuFlatButton10_Click(object sender, EventArgs e)
        {
            rdn.Visible = false;
            MaterialSkin.Controls.MaterialRadioButton bb = new MaterialSkin.Controls.MaterialRadioButton();
            foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
            {
                this.panel1.Controls.Remove(b);
            }
            if (dgv_eleves.SelectedRows.Count == 1)
            {
                chart C     = new chart(chart_e, this.id);
                Eleve eleve = el[dgv_eleves.SelectedRows[0].Index];

                foreach (Matiere m in this.matieres)
                {
                    C.addChartEvolutionUnites(eleve, m);
                }

                Matieres_b = C.series_bb;
                int y = chart_e.Location.Y;
                foreach (MaterialSkin.Controls.MaterialRadioButton l in Matieres_b)
                {
                    l.Location = new Point(chart_e.Location.X + chart_e.Width + 10, y);
                    l.Parent   = panel1;
                    y         += 25;
                    l.Show();
                    l.Checked = true;
                }
            }
        }
Пример #3
0
        public void addChartEvolutionUnites(Eleve eleve, Matiere matiere)
        {
            Series s = new Series
            {
                ChartType = SeriesChartType.Column
            };

            int i = 0;

            s.IsValueShownAsLabel = true;
            s.Name     = matiere.intitule;
            Login.read = DBConnect.Gets("Select unite , avg(note) from examiner,annee where id_matiere=" + matiere.id + " and  id_etudiant=" + eleve.id + " and id_annee=annee.id and annee.annee_scolaire='" + HomePreview.idann + "' group by unite");
            Random r = new Random();

            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[0].ToString(), Math.Round(float.Parse(Login.read[1].ToString()), 2));
                s.Points[i].MarkerSize = 9;
                s.Points[i++].Color    = Color.FromArgb(r.Next(150, 256), r.Next(0, 256), r.Next(0, 256), r.Next(0, 256));
            }
            Login.read.Close();

            MaterialSkin.Controls.MaterialRadioButton bb = new MaterialSkin.Controls.MaterialRadioButton();
            this.c.Series.Add(s);
            bb.Text = s.Name;
            this.series_bb.Add(bb);
            bb.CheckedChanged += Bb_Click;
        }
Пример #4
0
        public void addChartEvolutionSeries(Eleve eleve, Matiere matiere)
        {
            Series s = new Series
            {
                ChartType = SeriesChartType.Line
            };

            s.BorderWidth = 3;
            int i = 0;

            s.IsValueShownAsLabel = true;
            s.Name     = matiere.intitule;
            Login.read = DBConnect.Gets(string.Format("SELECT avg(note), titre FROM examiner where id_etudiant = {0} and id_groupe = {1} and id_matiere = {2} group by titre order by titre", eleve.id, this.id_class, matiere.id));
            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[1].ToString(), Math.Round(float.Parse(Login.read[0].ToString()), 2));
                s.Points[i].MarkerSize    = 9;
                s.Points[i++].MarkerStyle = MarkerStyle.Circle;
            }
            Login.read.Close();
            this.c.Series.Add(s);
            MaterialSkin.Controls.MaterialCheckBox b = new MaterialSkin.Controls.MaterialCheckBox();
            b.Text    = s.Name;
            b.Checked = true;
            this.series_bs.Add(b);
            b.CheckedChanged += B_Click;
        }
Пример #5
0
        public Groupe(string id, string groupe)
        {
            InitializeComponent();
            this.id            = id;
            this.groupe        = groupe;
            this.groupe_l.Text = groupe; int s = 1;
            Login.read         = DBConnect.Gets("SELECT ma.id, ma.nom FROM groupe_matiere_enseignant, matiere as ma WHERE ma.id = id_matiere and id_groupe = " + id);
            int  w = 12;
            int  t = 10;
            bool r = false;

            while (Login.read.Read())
            {
                if (r)
                {
                    r           = false;
                    panel2.Size = new Size(panel2.Width, panel2.Height + 63);
                }
                this.matieres.Add(new Matiere(Login.read[0].ToString(), Login.read[1].ToString()));
                Bunifu.Framework.UI.BunifuFlatButton bs = new Bunifu.Framework.UI.BunifuFlatButton();
                bs.Size      = new Size(210, 43);
                bs.Iconimage = Properties.Resources.diploma;
                bs.IconZoom  = 60;
                bs.Text      = Login.read[1].ToString().Substring(0, 1).ToUpper() + Login.read[1].ToString().Substring(1, Login.read[1].ToString().Length - 1);
                dictionary.Add(Login.read[1].ToString().Substring(0, 1).ToUpper() + Login.read[1].ToString().Substring(1, Login.read[1].ToString().Length - 1), Login.read[0].ToString());
                bs.BackColor    = Color.FromArgb(107, 124, 140);
                bs.Normalcolor  = Color.FromArgb(107, 124, 140);
                bs.Activecolor  = Color.FromArgb(107, 124, 140);
                bs.OnHovercolor = Color.FromArgb(97, 114, 130);
                bs.Location     = new Point(w, t);
                bs.Click       += new EventHandler(this.click_matiere);
                panel2.Controls.Add(bs);
                Matieres.Add(bs);
                w += bs.Width + 5;
                if (s % 3 == 0)
                {
                    t += bs.Height + 5;
                    w  = panel2.Location.X;
                    r  = true;
                }
                s += 1;
            }
            Login.read.Close();
            Login.read = DBConnect.Gets("SELECT id, id_massar, nom, prenom, nom_ar, prenom_ar, sexe, ville_naissance, ville_naissance_ar, adresse, date_naissance FROM etudiant, etudiant_groupe where id_groupe = " + id + " and id_etudiant = id");
            while (Login.read.Read())
            {
                //Login.read[7].ToString()
                Eleve es = new Eleve(Login.read[0].ToString(), Login.read[1].ToString(), Login.read[2].ToString(), Login.read[3].ToString(), Login.read[4].ToString(), Login.read[5].ToString(), Login.read[6].ToString(), Login.read[7].ToString(), Login.read[8].ToString(), Login.read[9].ToString());
                el.Add(es);
                countetu++;
            }

            Login.read.Close();
        }
Пример #6
0
        private void dgv_eleves_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == 2)
                {
                    string s = "1";
                    if (radioButton2.Checked)
                    {
                        s = "2";
                    }
                    Eleve ee = el[e.RowIndex];
                    if (DBConnect.Get("select semestre from examiner where id_etudiant=" + ee.id + " and semestre=" + s) == "")
                    {
                        MessageBox.Show("semestre introuvable");
                        return;
                    }
                    using (FolderBrowserDialog dlg = new FolderBrowserDialog())
                    {
                        dlg.Description = "Select a folder";
                        if (dlg.ShowDialog() == DialogResult.OK)
                        {
                            bulletin bul = new bulletin(dlg.SelectedPath + "\\" + "bulletin S" + s + " " + ee.nom + " " + ee.prenom + ".pdf", ee.id, s, HomePreview.idann, "amana");



                            MessageBox.Show("Bulletin bien generee");
                        }
                    }


                    return;
                }
                foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
                {
                    this.panel1.Controls.Remove(b);
                }
                chart c = new chart(chart_e, this.id);
                c.addChartByEtudiant(el[e.RowIndex].id);
                double moy = 0;
                foreach (var p in c.c.Series[0].Points)
                {
                    moy += p.YValues[0];
                }
                moy       /= c.c.Series[0].Points.Count();
                moy        = Math.Round(moy, 2);
                moy_g.Text = moy.ToString();
            }
        }
Пример #7
0
        private void bunifuFlatButton8_Click(object sender, EventArgs e)
        {
            foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
            {
                this.panel1.Controls.Remove(b);
            }
            if (dgv_eleves.SelectedRows.Count == 1)
            {
                chart C = new chart(chart_e, this.id);
                //chart_e.DataManipulator.Statistics.Median.

                Eleve eleve = el[dgv_eleves.SelectedRows[0].Index];

                C.addChartEvolutionAnneeEleve(eleve);
            }
        }
Пример #8
0
        public Groupe(string id, string groupe)
        {
            InitializeComponent();
            this.id            = id;
            this.groupe        = groupe;
            this.groupe_l.Text = groupe;

            Login.read = DBConnect.Gets("SELECT ma.id, ma.nom FROM groupe_matiere_enseignant, matiere as ma WHERE ma.id = id_matiere and id_groupe = " + id);
            int w = panel2.Location.X;

            while (Login.read.Read())
            {
                this.matieres.Add(new Matiere(Login.read[0].ToString(), Login.read[1].ToString()));
                Bunifu.Framework.UI.BunifuTileButton b = new Bunifu.Framework.UI.BunifuTileButton();
                b.Location    = new Point(w, panel2.Location.Y + panel2.Height + 20);
                b.LabelText   = Login.read[1].ToString().Substring(0, 1).ToUpper() + Login.read[1].ToString().Substring(1, Login.read[1].ToString().Length - 1) + "_" + Login.read[0];
                b.BackColor   = Color.FromArgb(230, 81, 0);
                b.colorActive = Color.FromArgb(230, 81, 0);
                b.color       = Color.FromArgb(230, 81, 0);
                b.Click      += new EventHandler(this.click_matiere);
                Matieres.Add(b);
                b.Size = new Size(100, 100);
                panel1.Controls.Add(b);
                w += b.Width + 10;
                b.Show();
            }
            Login.read.Close();
            Login.read = DBConnect.Gets("SELECT id, id_massar, nom, prenom, nom_ar, prenom_ar, sexe, ville_naissance, ville_naissance_ar, adresse, date_naissance FROM etudiant, etudiant_groupe where id_groupe = " + id + " and id_etudiant = id");
            while (Login.read.Read())
            {
                //Login.read[7].ToString()
                Eleve e = new Eleve(Login.read[0].ToString(), Login.read[1].ToString(), Login.read[2].ToString(), Login.read[3].ToString(), Login.read[4].ToString(), Login.read[5].ToString(), Login.read[6].ToString(), Login.read[7].ToString(), Login.read[8].ToString(), Login.read[9].ToString());
                el.Add(e);
                countetu++;
            }

            Login.read.Close();
        }
Пример #9
0
        public void addChartEvolutionAnneeEleve(Eleve eleve)
        {
            Series s = new Series
            {
                ChartType = SeriesChartType.Line
            };

            s.BorderWidth = 3;
            int i = 0;

            s.IsValueShownAsLabel = true;
            s.IsVisibleInLegend   = false;

            Login.read = DBConnect.Gets(string.Format("SELECT avg(note), titre FROM examiner where id_etudiant = {0} and id_groupe = {1} group by titre order by titre", eleve.id, this.id_class));
            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[1].ToString(), Math.Round(float.Parse(Login.read[0].ToString()), 2));
                s.Points[i].MarkerSize    = 9;
                s.Points[i++].MarkerStyle = MarkerStyle.Circle;
            }
            Login.read.Close();
            this.c.Series.Add(s);
        }