示例#1
0
        private void dgv_eleves_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == 0 || e.ColumnIndex == 1)
                {
                    rdnView();
                }
                if (e.ColumnIndex == 2)
                {
                    string s = "1";
                    if (radioButton2.Checked)
                    {
                        s = "2";
                    }
                    string id_E    = dgv_eleves.SelectedRows[0].Cells[3].Value.ToString();
                    string nomm    = dgv_eleves.SelectedRows[0].Cells[0].Value.ToString();
                    string prenomm = dgv_eleves.SelectedRows[0].Cells[1].Value.ToString();
                    if (DBConnect.Get("select semestre from examiner where id_etudiant=" + id_E + " 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 + " " + nomm + " " + prenomm + ".pdf", id_E, s, HomePreview.idann, "amana");



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


                    return;
                }
                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);
                }
                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();
            }
        }
示例#2
0
 public void homechart()
 {
     if (dgv_eleves.SelectedCells[0].RowIndex != -1)
     {
         foreach (MaterialSkin.Controls.MaterialCheckBox b in Matieres_bs)
         {
             this.panel1.Controls.Remove(b);
         }
         chart c = new chart(chart_e, this.id);
         c.addChartByEtudiant(el[dgv_eleves.SelectedRows[0].Index].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();
     }
 }