Exemplo n.º 1
0
        protected void generer_btn_Click(object sender, EventArgs e)
        {
            Class_Reports rap = new Class_Reports();

            if (type == 0)
            {
                conn = new MySqlConnection(LoginForm.MyString);
                conn.Open();
                string rqt0 = "select count(DISTINCT semestre) from semestre INNER JOIN unite ON unite.id_semestre=semestre.id_semestre"
                              + "  WHERE unite.id_annee=@anne AND unite.id_faculte=@faculte AND unite.id_departement=@departement AND unite.id_classe=@classe";
                MySqlCommand cmd0 = new MySqlCommand(rqt0, conn);
                cmd0.Parameters.AddWithValue("@anne", id_annee);
                cmd0.Parameters.AddWithValue("@faculte", id_faculte);
                cmd0.Parameters.AddWithValue("@departement", id_departement);
                cmd0.Parameters.AddWithValue("@classe", id_classe);
                int nb_Semestre = Convert.ToInt32(cmd0.ExecuteScalar());
                conn.Close();

                if (nb_Semestre != 0)
                {
                    rap.Etudiant_Rapport_Presence_par_Classe(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, has_departement, nbr_cours);
                }
                else
                {
                    Response.Write("<script>alert('Echec, la classe ne contient pas des Semestres')</script>");
                }
            }
            else if (type == 1)
            {
                rap.Etudiant_Rapport_Presence_par_Cours(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, has_departement, nbr_cours, nom_cours, credit_cour, id_cours);
            }
        }
        protected void Print_Button_Click(object sender, ImageClickEventArgs e)
        {
            Class_Reports rap = new Class_Reports();

            Response.Write("<script>alert('" + id_annee + " ," + annee + " ," + id_faculte + " ," + nom_faculte + " ," + has_depaartement + " ," + id_departement + " ," + nom_departement + " ," + id_classe + " ," + nom_classe + " ," + id_cours + " ," + nom_cours + "')</script>");
            rap.prestations_history(id_annee, annee, id_faculte, nom_faculte, has_depaartement, id_departement, nom_departement, id_classe, nom_classe, id_cours, nom_cours);
        }
        protected void generer_btn_Click(object sender, EventArgs e)
        {
            Class_Reports rap = new Class_Reports();

            if (type == 1)
            {
                rap.Etudiant_Rapport_Presence_par_Cours(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, has_departement, nbr_cours, nom_cours, credit_cour, id_cours);
            }
        }
        protected void ClasseCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            id_classe  = Convert.ToInt32(ClasseCombo.SelectedValue);
            nom_classe = ClasseCombo.SelectedItem.Text;
            Load_Cours();
            Load_etudiant();

            conn = new MySqlConnection(Authentification.MyString);
            conn.Open();
            //MessageBox.Show(id_annee + "  " + id_faculte);
            string       sql0 = "SELECT COUNT(*) FROM cours WHERE id_annee = @id_annee AND id_faculte = @id_faculte AND id_departement = @id_departement AND id_classe = @id_classe;";
            MySqlCommand cmd0 = new MySqlCommand(sql0, conn);

            cmd0.Parameters.AddWithValue("@id_annee", id_annee);
            cmd0.Parameters.AddWithValue("@id_faculte", id_faculte);
            cmd0.Parameters.AddWithValue("@id_departement", id_departement);
            cmd0.Parameters.AddWithValue("@id_classe", id_classe);
            nbr_cours = Convert.ToInt32(cmd0.ExecuteScalar());
            conn.Close();

            Class_Reports rap = new Class_Reports();

            if (type == 0)
            {
                conn = new MySqlConnection(Authentification.MyString);
                conn.Open();
                string rqt0 = "select count(DISTINCT semestre) from semestre INNER JOIN unite ON unite.id_semestre=semestre.id_semestre"
                              + "  WHERE unite.id_annee=@anne AND unite.id_faculte=@faculte AND unite.id_departement=@departement AND unite.id_classe=@classe";
                MySqlCommand cmd = new MySqlCommand(rqt0, conn);
                cmd.Parameters.AddWithValue("@anne", id_annee);
                cmd.Parameters.AddWithValue("@faculte", id_faculte);
                cmd.Parameters.AddWithValue("@departement", id_departement);
                cmd.Parameters.AddWithValue("@classe", id_classe);
                int nb_Semestre = Convert.ToInt32(cmd.ExecuteScalar());
                conn.Close();

                if (nb_Semestre != 0)
                {
                    rap.Etudiant_Rapport_Presence_par_Classe(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, has_departement, nbr_cours);
                }
                else
                {
                    Response.Write("<script>alert('Echec, la classe ne contient pas des Semestres')</script>");
                }
            }
            else if (type == 3)
            {
                // Response.Write("Echec de chargement des etudiants");
                rap.rapprochement_presence_reussite(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, has_departement);
            }
        }
        protected void Button_etud_Click(object sender, EventArgs e)
        {
            Class_Reports rap = new Class_Reports();

            rap.Rapport_Presence_par_etudiant(id_annee, id_faculte, id_departement, id_classe, nom_anne, nom_faculte, nom_departement, nom_classe, id_etudiant, nom_etudiant, date_text.Value);
        }
Exemplo n.º 6
0
        protected void Enregistrer_Button_Click(object sender, EventArgs e)
        {
            //try
            //{
            conn.Open();
            if (NomTextBox.Text != "" && PrenomTextBox.Text != "" && Region_ComboBox.SelectedValue != "-1" && PaysTextBox.Text != "" && Genre_ComboBox.SelectedValue != "-1" && EtatCivil_ComboBox.SelectedValue != "-1" && Identite_Type_ComboBox.SelectedValue != "-1" && IdentiteNumberTextBox.Text != "" && EmailTextBox.Text != "")
            {
                string       req = "SELECT COUNT(*) FROM etudiant WHERE nom=@nom AND prenom=@prenom AND naissance_date=@naissance_date AND naissance_pays=@pays AND email=@email";
                MySqlCommand cmd = new MySqlCommand(req, conn);
                cmd.Parameters.AddWithValue("@nom", NomTextBox.Text);
                cmd.Parameters.AddWithValue("@prenom", PrenomTextBox.Text);
                cmd.Parameters.AddWithValue("@naissance_date", NaissanceDatePicker.Text);
                cmd.Parameters.AddWithValue("@pays", PaysTextBox.Text);
                cmd.Parameters.AddWithValue("@email", EmailTextBox.Text);
                int nbre_etu = Convert.ToInt32(cmd.ExecuteScalar());
                if (nbre_etu == 0)
                {
                    Generate_Matricule();

                    string str = "INSERT INTO etudiant(code_inscri, matricule, nom, prenom, genre, naissance_date, naissance_region, naissance_pays, naissance_province, naissance_commune," +
                                 " naissance_zone, etat_civil, identite, telephone, email, etablissement, section, promotion, note_classe, note_exetat, note_synthese, note_medecine,reussite_exetat, hebergement, boursier,etat_etudes,photo)" +
                                 " VALUES (@code_inscri, @matricule, @nom, @prenom, @genre, @naissance_date, @naissance_region, @naissance_pays, @naissance_province, @naissance_commune, @naissance_zone," +
                                 " @etat_civil, @identite, @telephone, @email, @etablissement, @section, @promotion, @note_classe, @note_exetat, @note_synthese, @note_medecine, @reussite_exetat,@hebergement, @boursier,@etat_etudes,@photo)";
                    MySqlCommand cmda = new MySqlCommand(str, conn);
                    cmda.Parameters.AddWithValue("@code_inscri", code_inscri);
                    cmda.Parameters.AddWithValue("@matricule", matricule);
                    cmda.Parameters.AddWithValue("@nom", NomTextBox.Text);
                    cmda.Parameters.AddWithValue("@prenom", PrenomTextBox.Text);
                    cmda.Parameters.AddWithValue("@genre", Genre_ComboBox.Text);
                    cmda.Parameters.AddWithValue("@naissance_date", NaissanceDatePicker.Text);
                    cmda.Parameters.AddWithValue("@naissance_region", Region_ComboBox.Text);
                    cmda.Parameters.AddWithValue("@naissance_pays", PaysTextBox.Text);
                    cmda.Parameters.AddWithValue("@naissance_province", ProvinceTextBox.Text);
                    cmda.Parameters.AddWithValue("@naissance_commune", CommuneTextBox.Text);
                    cmda.Parameters.AddWithValue("@naissance_zone", ZoneTextBox.Text);
                    cmda.Parameters.AddWithValue("@etat_civil", EtatCivil_ComboBox.Text);
                    cmda.Parameters.AddWithValue("@identite", Identite_Type_ComboBox.Text + "-" + IdentiteNumberTextBox.Text);
                    cmda.Parameters.AddWithValue("@telephone", PhoneTextBox.Text);
                    cmda.Parameters.AddWithValue("@email", EmailTextBox.Text);
                    cmda.Parameters.AddWithValue("@etablissement", EtablissementTextbox.Text);
                    cmda.Parameters.AddWithValue("@section", SectionTextBox.Text);
                    cmda.Parameters.AddWithValue("@promotion", PromotionTextbox.Text);
                    cmda.Parameters.AddWithValue("@note_classe", NoteClasseTextbox.Text);
                    cmda.Parameters.AddWithValue("@note_exetat", NoteExetatTextBox.Text);
                    cmda.Parameters.AddWithValue("@note_synthese", NoteSynthesetextBox.Text);
                    cmda.Parameters.AddWithValue("@note_medecine", NoteTestMedecineTextBox.Text);
                    cmda.Parameters.AddWithValue("@reussite_exetat", etat_exetat);
                    cmda.Parameters.AddWithValue("@hebergement", id_hebergement);
                    cmda.Parameters.AddWithValue("@boursier", id_boursier);
                    cmda.Parameters.AddWithValue("@etat_etudes", etat_etudes);
                    cmda.Parameters.AddWithValue("@photo", file_path);
                    cmda.ExecuteNonQuery();
                    Response.Write("<script>alert('Enregistrement reussie !')</script>");

                    MatriculeTextbox.Text = matricule;

                    Class_Reports rp = new Class_Reports();
                    rp.etudiant_matricule_Generate_pdf(NomTextBox.Text.ToString(), PrenomTextBox.Text.ToString(), MatriculeTextbox.Text);

                    ViderLesChamps();
                    Base.charger_GridView(sender, e, "SELECT id_etudiant, concat(nom,' ',prenom)as etudiant , matricule, telephone, naissance_pays, note_classe, note_exetat FROM etudiant ORDER BY id_etudiant DESC LIMIT 20", Gridetudiant);
                }
                else
                {
                    Response.Write("<script>alert('Etudiant existe deja !')</script>");
                    ViderLesChamps();
                }
            }
            else
            {
                Response.Write("<script>alert('Chargez toutes les informations necessaire svp!')</script>");
            }
            conn.Close();
            cpt_etat_etudes = -1;
            cpt_etat_exetat = -1;
            //}
            //catch (Exception ex)
            //{
            //    Response.Write("<script>alert(' Echec, enregistrement echoué !')</script>");
            //    return;
            //}
        }