Пример #1
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;
        }
Пример #2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == 10)
                {
                    string id_groupe  = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
                    string id_matiere = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
                    string id_annee   = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                    string title      = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();
                    string semestre   = dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString();
                    int    NbMatiere  = int.Parse(DBConnect.Get("select count(id_matiere) from (select distinct id_annee, id_groupe, id_matiere, titre, semestre, author, insertion from examiner where id_matiere='" + id_matiere + "') as s"));
                    Login.read = DBConnect.Gets("select count(id_enseignant), id_enseignant from groupe_matiere_enseignant where id_enseignant=(select id_enseignant from groupe_matiere_enseignant where id_matiere=" + id_matiere + " and id_groupe='" + id_groupe + "')");
                    Login.read.Read();
                    int    prof    = int.Parse(Login.read[0].ToString());
                    string id_prof = Login.read[1].ToString();
                    Login.read.Close();

                    DBConnect.Post("delete from examiner where id_annee='" + id_annee + "' and id_groupe='" + id_groupe + "' and id_matiere='" + id_matiere + "' and titre='" + title + "' and semestre='" + semestre + "'");
                    DBConnect.Post("delete from groupe_matiere_enseignant where id_groupe='" + id_groupe + "' and id_matiere='" + id_matiere + "'");
                    if (NbMatiere == 1)
                    {
                        DBConnect.Post("delete from matiere where id='" + id_matiere + "'");
                    }
                    if (prof == 1)
                    {
                        DBConnect.Post("delete from enseignant where id='" + id_prof + "'");
                    }
                    Historique_Load(null, null);
                }
            }
        }
Пример #3
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;
        }
Пример #4
0
 void loadYears()
 {
     Login.read = DBConnect.Gets("select annee_scolaire from annee order by annee_scolaire desc ; ");
     while (Login.read.Read())
     {
         listYear.Add(Login.read["annee_scolaire"].ToString());
     }
     Login.read.Close();
 }
Пример #5
0
        public void rdnView()
        {
            foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
            {
                this.panel1.Controls.Remove(b);
            }
            foreach (MaterialSkin.Controls.MaterialRadioButton b in Matieres_b)
            {
                this.panel1.Controls.Remove(b);
            }
            rdn.Rows.Clear();
            rdn.Columns.Clear();
            rdn.Visible = true;
            this.rdn.Columns.Add("Matière", "Matière");
            this.rdn.Columns.Add("Semestre1", "CC1");
            this.rdn.Columns.Add("Semestre1", "CC2");
            this.rdn.Columns.Add("Semestre1", "CC3");
            this.rdn.Columns.Add("Semestre1", "CC4");
            this.rdn.Columns.Add("Semestre1", "CC5");
            this.rdn.Columns.Add("Semestre2", "CC1");
            this.rdn.Columns.Add("Semestre2", "CC2");
            this.rdn.Columns.Add("Semestre2", "CC3");
            this.rdn.Columns.Add("Semestre2", "CC4");
            this.rdn.Columns.Add("Semestre2", "CC5");

            for (int j = 0; j < rdn.ColumnCount; j++)

            {
                rdn.Columns[j].Width = rdn.Width / 11;
            }

            string id_E = dgv_eleves.SelectedRows[0].Cells[3].Value.ToString();

            Console.WriteLine(id_E);

            string sql = "select nom as matiere, sum(if(semestre = 1 and titre = 'cc1', note, null)) as s1cc1, " +
                         "sum(if (semestre = 1 and titre = 'cc2', note, null)) as s1cc2, " +
                         "sum(if (semestre = 1 and titre = 'cc3', note, null)) as s1cc3, " +
                         "sum(if (semestre = 1 and titre = 'cc4', note, null)) as s1cc4, " +
                         "sum(if (semestre = 1 and titre = 'cc5', note, null)) as s1cc5, " +
                         "sum(if (semestre = 2 and titre = 'cc1', note, null)) as s2cc1, " +
                         "sum(if (semestre = 2 and titre = 'cc2', note, null)) as s2cc2, " +
                         "sum(if (semestre = 2 and titre = 'cc3', note, null)) as s2cc3, " +
                         "sum(if (semestre = 2 and titre = 'cc4', note, null)) as s2cc4, " +
                         "sum(if (semestre = 2 and titre = 'cc5', note, null)) as s2cc5 " +
                         "from(SELECT nom, semestre, titre, avg(note) as note FROM examiner " +
                         "LEFT OUTER JOIN matiere on examiner.id_matiere = matiere.id where id_etudiant = " + id_E + " group by nom, titre)" +
                         " as t2 GROUP by t2.nom, t2.semestre";

            Login.read = DBConnect.Gets(sql);
            while (Login.read.Read())
            {
                rdn.Rows.Add(Login.read[0], Login.read[1], Login.read[2], Login.read[3], Login.read[4], Login.read[5], Login.read[6], Login.read[7], Login.read[8], Login.read[9], Login.read[10]);
            }

            Login.read.Close();
        }
Пример #6
0
 private void viewprofesseur_Load(object sender, EventArgs e)
 {
     Login.read = DBConnect.Gets("select e.nom,e.prenom,avg(ex.note) from annee as a , examiner as ex, groupe as g , enseignant as e , groupe_matiere_enseignant as gme where gme.id_enseignant=e.id  and gme.id_groupe=g.id and gme.id_groupe=ex.id_groupe and gme.id_matiere=ex.id_matiere and ex.id_annee=a.id and a.annee_scolaire='" + HomePreview.idann + "' group by e.id");
     while (Login.read.Read())
     {
         bunifuCustomDataGrid1.Rows.Add(Login.read[0].ToString(), Login.read[1].ToString(), (Math.Round(Double.Parse(Login.read[2].ToString()) * 10, 2)) + "%");
     }
     Login.read.Close();
 }
Пример #7
0
 private void classview_Load(object sender, EventArgs e)
 {
     bunifuCustomDataGrid1.Rows.Clear();
     Login.read = DBConnect.Gets("select groupe.nom , groupe.id ,count(etudiant_groupe.id_etudiant) from etudiant_groupe , groupe,  annee where groupe.id=etudiant_groupe.id_groupe and  annee.annee_scolaire='" + HomePreview.idann + "' and  annee.id=groupe.id_annee group by etudiant_groupe.id_groupe ; ");
     while (Login.read.Read())
     {
         bunifuCustomDataGrid1.Rows.Add(Login.read["id"].ToString(), Login.read["nom"].ToString(), Login.read[2].ToString(), "supprimer");
     }
     Login.read.Close();
 }
Пример #8
0
 private void Historique_Load(object sender, EventArgs e)
 {
     dataGridView1.Rows.Clear();
     Login.read = DBConnect.Gets("select distinct annee_scolaire, examiner.id_annee, groupe.nom, id_groupe, matiere.nom,id_matiere, titre, semestre, author, insertion from examiner ,annee, matiere, groupe where id_groupe=groupe.id and examiner.id_annee= annee.id and matiere.id = examiner.id_matiere order by insertion desc");
     while (Login.read.Read())
     {
         dataGridView1.Rows.Add(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(), "Supprimer");
     }
     Login.read.Close();
 }
Пример #9
0
        public Subjects(string idm, string nomm)
        {
            InitializeComponent();
            semestre = new string[10] {
                "1", "1", "1", "1", "1", "2", "2", "2", "2", "2"
            };
            cl_buttons.Add(Button1); cl_buttons.Add(Button2); cl_buttons.Add(Button3); cl_buttons.Add(Button6); cl_buttons.Add(Button7); cl_buttons.Add(Button8); cl_buttons.Add(Button4); cl_buttons.Add(Button5); cl_buttons.Add(Button9); cl_buttons.Add(Button10);
            foreach (Bunifu.Framework.UI.BunifuTileButton b in cl_buttons)
            {
                b.Click += new System.EventHandler(this.clickcc);
            }
            string id    = HomePreview.id;
            string nomgr = HomePreview.nomgr;

            this.idm  = idm;
            this.nomm = nomm;
            chart ch = new chart(chart1, HomePreview.id);

            ch.addChartBy(nom: nomgr);

            Login.read = DBConnect.Gets("select max(calcule.n), min(calcule.n) , avg(calcule.n) from (select avg(note) as n from examiner where id_matiere=" + this.idm + " group by id_etudiant) as calcule");
            if (Login.read.Read())
            {
                max.Text = Login.read[0].ToString();
                min.Text = Login.read[1].ToString();
                moy      = Login.read[2].ToString();
            }
            bunifuCircleProgressbar1.Value = (int)Math.Ceiling(float.Parse(moy));

            Login.read = DBConnect.Gets("select nom , prenom from groupe_matiere_enseignant , enseignant where id_enseignant=id and id_groupe=" + id + " and id_matiere=" + this.idm);
            while (Login.read.Read())
            {
                label2.Text = Login.read["nom"].ToString() + " " + Login.read["prenom"].ToString();
            }
            Login.read.Close();

            moyenne.Text = Math.Round(double.Parse(moy), 2).ToString();
            if (double.Parse(moyenne.Text) < 5)
            {
                bunifuCircleProgressbar1.ProgressColor = Color.Red;
            }
            else
            {
                bunifuCircleProgressbar1.ProgressColor = Color.Green;
            }
            Login.read = DBConnect.Gets("select distinct titre from examiner where id_groupe = " + id + " and id_matiere=" + this.idm + " order by semestre,titre");
            int i = 0;

            while (Login.read.Read())
            {
                cl_buttons[i++].Visible = true;
            }
            Login.read.Close();
            Infobox.Text = this.nomm;
        }
Пример #10
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();
        }
Пример #11
0
        private void viewprofesseur_Load(object sender, EventArgs e)
        {
            List <string> tmp = new List <string>();

            Login.read = DBConnect.Gets("select e.nom,e.prenom,avg(ex.note) from annee as a , examiner as ex, groupe as g , enseignant as e , groupe_matiere_enseignant as gme where gme.id_enseignant=e.id  and gme.id_groupe=g.id and gme.id_groupe=ex.id_groupe and gme.id_matiere=ex.id_matiere and ex.id_annee=a.id and a.annee_scolaire='" + HomePreview.idann + "' group by e.id");
            while (Login.read.Read())
            {
                pl.Add(new List <string>());
                pl[pl.Count - 1].Add(Login.read[0].ToString());
                pl[pl.Count - 1].Add(Login.read[1].ToString());
                pl[pl.Count - 1].Add(Login.read[2].ToString());
            }
            Login.read.Close();
            setData(pl);
        }
Пример #12
0
        void add_table_topdf(int pourcentage = 100)
        {
            MySqlDataReader r = DBConnect.Gets("select etudiant.nom, matiere.nom ,examiner.unite, examiner.note,AVG(note)  FROM etudiant,matiere , examiner WHERE semestre=" + semestre + " and etudiant.id=examiner.id_etudiant and examiner.id_etudiant=11671321 and matiere.id=examiner.id_matiere GROUP by unite,examiner.id_matiere ORDER by examiner.id_matiere");

            string[] cols = { "ملاحظات الاساتذة", "نقط المراقبة المستمرة", "المكونات", "المواد" };
            foreach (string c in cols)
            {
                PdfPCell cell = new PdfPCell(new Phrase(c, myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                table.AddCell(cell);
            }
            table.WidthPercentage = pourcentage;
            string        now = "", last = "", MATIERE = "";
            int           x = 0;
            int           i = 0;
            List <float>  n = new List <float>();
            List <string> u = new List <string>();

            while (r.Read())
            {
                now = r[1].ToString();
                if (x++ == 0)
                {
                    last = now;
                }
                if (now == last)
                {
                    MATIERE = r[1].ToString();
                    n.Add(float.Parse(r[4].ToString()));
                    u.Add(r[2].ToString());
                }
                else
                {
                    doo(MATIERE, n, u);
                    n.Clear();
                    u.Clear();
                    MATIERE = r[1].ToString();
                    n.Add(float.Parse(r[4].ToString()));
                    u.Add(r[2].ToString());
                }
                last = now;
            }
            doo(MATIERE, n, u);
            document.Add(table);
            r.Close();
        }
Пример #13
0
        void refresh()
        {
            int i = 0;

            lesAdmins.Clear();
            Admins.Rows.Clear();
            Login.read = DBConnect.Gets("select * from admin ;");
            while (Login.read.Read())
            {
                Admins.Rows.Add(Login.read["nom"], "", Login.read["isSuper"], "Supprimer", "Modifier");
                lesAdmins.Add(new string[] { Login.read["nom"].ToString(), "", Login.read["isSuper"].ToString() });
                if (Login.admin.nom == Login.read["nom"].ToString())
                {
                    Admins.Rows[i].Cells[2].ReadOnly = true;
                }
            }
            Login.read.Close();
        }
Пример #14
0
        public void addChartBy(string nom = "", SeriesChartType typechart = SeriesChartType.Column, string id_matiere = "", string unite = "", string semestre = "", string titre = "")
        {
            string query2 = "SELECT id_etudiant,prenom ,nom, avg(note) as n from examiner , etudiant where etudiant.id=id_etudiant and  id_groupe=" + this.id_class + " and";

            if (id_matiere != "")
            {
                query2 += " id_matiere=" + id_matiere + " and";
            }
            if (unite != "")
            {
                query2 += " unite='" + unite + "' and";
            }
            if (semestre != "")
            {
                query2 += " semestre='" + semestre + "' and";
            }
            if (titre != "")
            {
                query2 += " titre='" + titre + "' and";
            }
            if (query2.EndsWith("and"))
            {
                query2 = query2.Substring(0, query2.Length - 3);
            }
            query2 += " group by id_etudiant ";

            Series s = new Series {
                ChartType = typechart
            };


            Login.read = DBConnect.Gets(query2);
            int q = 0;

            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read["nom"].ToString(), Double.Parse(Login.read["n"].ToString()));
                s.Points[q++].ToolTip = Math.Round(Double.Parse(Login.read["n"].ToString()), 2, MidpointRounding.AwayFromZero).ToString();
            }
            s.Name = nom;
            this.c.Series.Add(s);
            //this.c.Series.Add(s);
            Login.read.Close();
        }
Пример #15
0
        void loadClasse()
        {
            int i = 0;

            foreach (var b in ClassButton)
            {
                if (b.GetType() == typeof(BunifuFlatButton))
                {
                    panel3.Controls.Remove((BunifuFlatButton)b);
                }
            }
            ClassButton.Clear();
            id_classes.Clear();

            Login.read = DBConnect.Gets("select groupe.nom , groupe.id from groupe , annee where annee.annee_scolaire='" + listYear[yearSelected] + "' and  annee.id=groupe.id_annee ; ");

            while (Login.read.Read())
            {
                ClassButton.Add(new BunifuFlatButton());
                ClassButton[i].Size         = new Size(panel3.Width, 48);
                ClassButton[i].TextFont     = new Font(latoReg.Families[0], 12, FontStyle.Bold);
                ClassButton[i].Textcolor    = Color.FromArgb(54, 78, 102);
                ClassButton[i].BackColor    = Color.FromArgb(233, 233, 233);
                ClassButton[i].Activecolor  = Color.FromArgb(107, 124, 140);
                ClassButton[i].Normalcolor  = Color.FromArgb(233, 233, 233);
                ClassButton[i].OnHovercolor = Color.FromArgb(200, 200, 200);
                ClassButton[i].Click       += new EventHandler(this.Classe_Click);
                ClassButton[i].Text         = Login.read["nom"].ToString();
                ClassButton[i].IsTab        = true;
                if (i == 0)
                {
                    ClassButton[i].Location = new Point(panel3.Location.X, search.Location.Y + search.Height);
                }
                else
                {
                    ClassButton[i].Location = new Point(panel3.Location.X, ClassButton[i - 1].Location.Y + ClassButton[i - 1].Height);
                }
                id_classes.Add(Login.read["id"].ToString());
                panel3.Controls.Add(ClassButton[i++]);
            }
            Login.read.Close();
            nbrClasse = ClassButton.Count;
        }
Пример #16
0
        private void viewetudiant_Load(object sender, EventArgs e)
        {
            Login.read = DBConnect.Gets("select e.id_massar, e.nom, e.prenom, e.sexe , g.nom, e.password , e.active from etudiant  as e, etudiant_groupe as eg , groupe as g, annee as a where  eg.id_etudiant=e.id and eg.id_groupe=g.id and g.id_annee=a.id and a.annee_scolaire='" + HomePreview.idann + "'");
            etudiants  = new List <List <string> >();
            int i = 0;

            while (Login.read.Read())
            {
                etudiants.Add(new List <string>());
                etudiants[i].Add(Login.read[0].ToString());
                etudiants[i].Add(Login.read[1].ToString());
                etudiants[i].Add(Login.read[2].ToString());
                etudiants[i].Add(Login.read[3].ToString());
                etudiants[i].Add(Login.read[4].ToString());
                etudiants[i].Add((Login.read[5].ToString() == "") ? "": "deja genere");
                etudiants[i++].Add(Login.read[6].ToString());
            }
            Login.read.Close();
            setDataGridView(etudiants);
        }
Пример #17
0
        private void Home_Load(object sender, EventArgs e)
        {
            MaterialSkin.MaterialSkinManager skinManager = MaterialSkin.MaterialSkinManager.Instance;
            skinManager.AddFormToManage(this);
            skinManager.ColorScheme = new MaterialSkin.ColorScheme(MaterialSkin.Primary.Blue700, MaterialSkin.Primary.Blue900, MaterialSkin.Primary.BlueGrey500, MaterialSkin.Accent.Orange700, MaterialSkin.TextShade.WHITE);
            SuperUser.Visible       = Login.admin.isSuper;
            annees.Font             = new Font("Arial", 14);
            annees.Items.Clear();

            Login.read = DBConnect.Gets("select annee_scolaire from annee order by annee_scolaire desc ; ");
            while (Login.read.Read())
            {
                annees.Items.Add(Login.read["annee_scolaire"].ToString());
            }
            Login.read.Close();
            if (annees.Items.Count > 0)
            {
                annees.SelectedIndex = 0;
            }
            loadgroupes(annees.SelectedItem.ToString());
        }
Пример #18
0
        public void evoann()
        {
            int    i = 0;
            Series s = new Series
            {
                ChartType = SeriesChartType.Line
            };

            this.c.ChartAreas[0].AxisY.Maximum = 100;
            s.Name     = "Evolution par annee";
            Login.read = DBConnect.Gets("select avg(note),annee_scolaire from examiner,annee where id_annee=id group by id_annee");
            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[1].ToString(), Double.Parse(Login.read[0].ToString()) * 10);
                s.Points[i].MarkerSize    = 9;
                s.Points[i++].MarkerStyle = MarkerStyle.Circle;
            }
            this.c.Series.Add(s);
            //this.c.Series.Add(s);
            Login.read.Close();
        }
Пример #19
0
        public void addChartByEtudiant(string id_et)
        {
            int i = 0;

            Series s = new Series
            {
                ChartType = SeriesChartType.StackedBar
            };

            //            s.Name = "";
            s.IsVisibleInLegend = false;

            Login.read = DBConnect.Gets("SELECT avg(note), nom from examiner, matiere where id_matiere=id and id_etudiant = " + id_et + " and id_groupe = " + id_class + " GROUP BY id_matiere");
            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read["nom"].ToString(), Double.Parse(Login.read[0].ToString()));
                s.Points[i].ToolTip = Math.Round(Double.Parse(Login.read[0].ToString()), 2, MidpointRounding.AwayFromZero).ToString();
                s.Points[i].Color   = this.col[i++];
            }
            this.c.Series.Add(s);
            Login.read.Close();
        }
Пример #20
0
        public void loadgroupes(string annee)
        {
            int i = 0;

            foreach (var b in cl_buttons)
            {
                if (b.GetType() == typeof(Bunifu.Framework.UI.BunifuFlatButton))
                {
                    panel1.Controls.Remove((Bunifu.Framework.UI.BunifuFlatButton)b);
                }
            }
            cl_buttons.Clear();
            id_classes.Clear();
            Login.read = DBConnect.Gets("select groupe.nom , groupe.id from groupe , annee where annee.annee_scolaire='" + annee + "' and  annee.id=groupe.id_annee ; ");
            while (Login.read.Read())
            {
                cl_buttons.Add(new Bunifu.Framework.UI.BunifuFlatButton());
                cl_buttons[i].Size         = new Size(panel1.Width, 48);
                cl_buttons[i].BackColor    = Color.FromArgb(13, 71, 161);
                cl_buttons[i].Activecolor  = Color.FromArgb(20, 91, 181);
                cl_buttons[i].Normalcolor  = Color.FromArgb(13, 71, 161);
                cl_buttons[i].OnHovercolor = Color.FromArgb(20, 91, 181);
                cl_buttons[i].Click       += new System.EventHandler(this.groupe);
                cl_buttons[i].Text         = Login.read["nom"].ToString();
                cl_buttons[i].IsTab        = true;
                if (i == 0)
                {
                    cl_buttons[i].Location = new Point(panel1.Location.X, search.Location.Y + search.Height);
                }
                else
                {
                    cl_buttons[i].Location = new Point(panel1.Location.X, cl_buttons[i - 1].Location.Y + cl_buttons[i - 1].Height);
                }
                id_classes.Add(Login.read["id"].ToString());
                panel1.Controls.Add(cl_buttons[i++]);
            }
            Home.nbrClasse = cl_buttons.Count;
            Login.read.Close();
        }
Пример #21
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();
        }
Пример #22
0
        public bool login(string nom, string pass)
        {
            this.logined = false;
            if (sqlingection(nom) || sqlingection(pass))
            {
                return(false);
            }
            MySqlDataReader r = DBConnect.Gets("select * from admin where password='******' and nom='" + nom + "' ;");

            while (r.Read())
            {
                this.id      = r["id"].ToString();
                this.nom     = r["nom"].ToString();
                isSuper      = Convert.ToBoolean(r["isSuper"].ToString());
                this.logined = true;
            }
            r.Close();
            if (!this.logined)
            {
                return(false);
            }
            return(true);
        }
Пример #23
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);
        }
Пример #24
0
        public bulletin(string pdfdirectory, string id = "11671321", string semestre = "1", string annee = "2017/2018", string ecole = "amana")
        {
            this.semestre = semestre;
            this.id       = id;
            this.annee    = annee;
            bf            = BaseFont.CreateFont(ARIALUNI_TFF, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
            document      = new Document();


            PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pdfdirectory, FileMode.Create));

            document.Open();
            writeline2(new string[] { "بيان النتائج الدراسية للدورة " + (semestre == "1" ? "الاولى" : "الثانية"), "الاكاديمية الجهوية للتربية و التكوين" }, 3, new int[] { 0, 1 }, 7);
            writeline2(new string[] { "Bulletin du " + (semestre == "1" ? "1 er" : "2 eme") + " semestre", "لجهة : طنجة تطوان" }, 3, new int[] { 0, 1 }, 7);
            writeline2(new string[] { "السنة الدراسية : " + annee, "نيابة : طنجة اصيلة" }, 3, new int[] { 0, 1 }, 10);
            writeline("مؤسسة : " + ecole, 3, 2, 10);
            iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance("C:\\Images\\img.png");
            pic.SetAbsolutePosition(390, 770);
            document.Add(new Paragraph("   \n"));
            pic.ScalePercent(((540 / 3) / pic.Width) * 100);
            document.Add(pic);
            MySqlDataReader r = DBConnect.Gets("select nom_ar,prenom_ar,groupe.nom,annee.annee_scolaire,id_massar from etudiant,groupe,annee,etudiant_groupe where etudiant.id=" + id + " and etudiant_groupe.id_etudiant=etudiant.id AND etudiant_groupe.id_groupe=groupe.id and groupe.id_annee=annee.id and annee.annee_scolaire='" + annee + "' ");

            while (r.Read())
            {
                writeline("المستوى : " + r[2].ToString().Substring(0, 1) + " ابتدائي", 1, 1, 20);
                writeline("القسم : " + r[2].ToString(), 1, 1, 20);
                writeline("اسم و رقم التلميذ : " + r[0].ToString() + " " + r[1].ToString() + " " + r[4].ToString(), 1, 1, 20);
            }
            document.Add(new Paragraph("   \n"));


            myfont = new Font(bf, 12, Font.NORMAL);
            add_table_topdf();
            PdfPTable resultat = new PdfPTable(new float[] { 1, 1, 1, 2 });

            string[] cols = { "المعدل العام", "الدورة الثانية", "الدورة الاولى", "" };
            foreach (string c in cols)
            {
                PdfPCell cell = new PdfPCell(new Phrase(c, myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell);
            }

            r = DBConnect.Gets("select semestre ,avg(note) from examiner where id_etudiant=" + id + " group by semestre order by semestre ");
            int          y  = 0;
            List <float> ff = new List <float>();

            while (r.Read())
            {
                ff.Add(float.Parse(r[1].ToString()));
                y++;
            }
            if (y == 2)
            {
                PdfPCell cell = new PdfPCell(new Phrase(ff.Average().ToString(), myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell);
                PdfPCell cell1 = new PdfPCell(new Phrase(ff[1].ToString(), myfont));
                cell1.HorizontalAlignment = 1;
                cell1.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell1);
                PdfPCell cell2 = new PdfPCell(new Phrase(ff[0].ToString(), myfont));
                cell2.HorizontalAlignment = 1;
                cell2.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell2);
            }
            else if (y == 1)
            {
                PdfPCell cell = new PdfPCell(new Phrase("", myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell);
                PdfPCell cell1 = new PdfPCell(new Phrase("", myfont));
                cell1.HorizontalAlignment = 1;
                cell1.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell1);
                PdfPCell cell2 = new PdfPCell(new Phrase(ff[0].ToString(), myfont));
                cell2.HorizontalAlignment = 1;
                cell2.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                resultat.AddCell(cell2);
            }
            PdfPCell cell3 = new PdfPCell(new Phrase("معدل المراقبة المستمرة", myfont));

            cell3.HorizontalAlignment = 1;
            cell3.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
            resultat.AddCell(cell3);
            r.Close();
            document.Add(new Paragraph("   \n"));
            resultat.WidthPercentage     = 40;
            resultat.HorizontalAlignment = Element.ALIGN_RIGHT;



            PdfPTable absences = new PdfPTable(2);
            PdfPCell  c1       = new PdfPCell(new Phrase("الغياب", myfont));

            c1.HorizontalAlignment = 1;
            c1.Colspan             = 2;
            c1.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
            absences.AddCell(c1);
            c1 = new PdfPCell(new Phrase("", myfont));
            c1.HorizontalAlignment = 1;

            c1.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            absences.AddCell(c1);
            c1 = new PdfPCell(new Phrase("مبرر", myfont));
            c1.HorizontalAlignment = 1;

            c1.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            absences.AddCell(c1);
            c1 = new PdfPCell(new Phrase("", myfont));
            c1.HorizontalAlignment = 1;

            c1.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            absences.AddCell(c1);
            c1 = new PdfPCell(new Phrase("غير مبرر", myfont));
            c1.HorizontalAlignment = 1;

            c1.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            absences.AddCell(c1);

            PdfPTable ch = new PdfPTable(new float[] { 4, 1, 4 });

            ch.WidthPercentage = 100;
            c1 = new PdfPCell(absences);
            c1.HorizontalAlignment = Element.ALIGN_LEFT;
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            c1        = new PdfPCell(new Phrase("", myfont));
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            c1 = new PdfPCell(resultat);
            c1.HorizontalAlignment = Element.ALIGN_RIGHT;
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            ch.HorizontalAlignment = Element.ALIGN_BOTTOM;



            PdfPTable etat = new PdfPTable(new float[] { 1, 1, 1, 1, 2 });

            c1 = new PdfPCell(new Phrase("قرار اللجنة", myfont));
            c1.HorizontalAlignment = 1;
            c1.Colspan             = 5;
            c1.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
            etat.AddCell(c1);

            string[] cols2 = { "توبيخ", "انذار", "تنويه", "تشجيع", "لوحة الشرف", " ", " ", " ", " ", " " };
            foreach (string c in cols2)
            {
                PdfPCell cell = new PdfPCell(new Phrase(c, myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                etat.AddCell(cell);
            }

            PdfPTable notes = new PdfPTable(new float[] { 1, 1, 1 });

            c1 = new PdfPCell(new Phrase("الملاحظات العامة", myfont));
            c1.HorizontalAlignment = 1;
            c1.Colspan             = 3;
            c1.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
            notes.AddCell(c1);

            string[] cols3 = { "يفصل", "يكرر", "ينتقل", " ", " ", " " };
            foreach (string c in cols3)
            {
                PdfPCell cell = new PdfPCell(new Phrase(c, myfont));
                cell.HorizontalAlignment = 1;
                cell.RunDirection        = PdfWriter.RUN_DIRECTION_RTL;
                notes.AddCell(cell);
            }
            document.Add(ch);
            document.Add(new Paragraph("   \n"));
            ch = new PdfPTable(new float[] { 4, 1, 4 });
            ch.WidthPercentage = 100;
            c1 = new PdfPCell(notes);
            c1.HorizontalAlignment = Element.ALIGN_LEFT;
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            c1        = new PdfPCell(new Phrase("", myfont));
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            c1 = new PdfPCell(etat);
            c1.HorizontalAlignment = Element.ALIGN_RIGHT;
            c1.Border = PdfPCell.NO_BORDER;
            ch.AddCell(c1);
            ch.HorizontalAlignment = Element.ALIGN_BOTTOM;

            document.Add(ch);
            document.Close();
        }