Beispiel #1
0
        public static double GetMoyenneModule(int Num)
        {
            double Nds = 0, Nexam = 0, MoyMod;

            cmd = new MySqlCommand(" Select DS, Examen from notes where IdEtudiant = ?", Connexion.Connect());
            MySqlParameter P = new MySqlParameter("NumInscription", Num);

            cmd.Parameters.Add(P);

            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Nds   = reader.GetDouble("DS");
                Nexam = reader.GetDouble("Examen");
            }

            MoyMod = (0.3 * Nds) + (0.7 * Nexam);

            reader.Close();

            return(MoyMod);
        }
Beispiel #2
0
        public static void AddNotes()
        {
            Notes N = new Notes(), Nt = new Notes();

            Nt = ExamenView.GetNotesEtudiant(N);

            cmd = new MySqlCommand(" Insert into notes values (@IdEtudiant,@IdModule,@DS,@Examen)", Connexion.Connect());
            cmd.Parameters.AddWithValue("@IdEtudiant", Nt.IdEtudiant);
            cmd.Parameters.AddWithValue("@IdModule", Nt.IdModule);
            cmd.Parameters.AddWithValue("@DS", Nt.DS);
            cmd.Parameters.AddWithValue("@Examen", Nt.Examen);

            cmd.ExecuteNonQuery();
        }
Beispiel #3
0
        public static Etudiant GetEtudiant(int Num)
        {
            Etudiant Et = new Etudiant();

            cmd = new MySqlCommand(" select * from etudiant where NumInscription = ?", Connexion.Connect());
            cmd.Parameters.Add(new MySqlParameter("NumInscription", Num));

            lire = cmd.ExecuteReader();

            while (lire.Read())
            {
                Et.NumInst   = lire.GetInt32("NumInscription");
                Et.Nom       = lire.GetString("Nom");
                Et.DateNaiss = lire.GetDateTime("DateNaiss");
            }

            Console.WriteLine(" Num : " + Et.NumInst + "\n Nom : " + Et.Nom + "\n Date naissance : " + Et.DateNaiss);

            lire.Close();

            return(Et);
        }
Beispiel #4
0
        public static void AddEtudiant()
        {
            Etudiant E  = new Etudiant();
            Etudiant Et = new Etudiant();

            Et = ExamenView.GetInfoEtudiant(E);

            cmd = new MySqlCommand(" Insert into etudiant values (@NumInscription, @Nom, @DateNaissance)", Connexion.Connect());
            cmd.Parameters.AddWithValue("@NumInscription", Et.NumInst);
            cmd.Parameters.AddWithValue("@Nom", Et.Nom);
            cmd.Parameters.AddWithValue("@DateNaissance", Et.DateNaiss);

            cmd.ExecuteNonQuery();
        }
Beispiel #5
0
        public static void DetailsNotes(int Num)
        {
            int code = 1;

            cmd = new MySqlCommand(" Select m.Intitule,n.DS,n.Examen from module m inner join notes n on m.Code = n.IdModule where IdEtudiant = ?", Connexion.Connect());
            MySqlParameter P = new MySqlParameter("IdEtudiant", Num);

            cmd.Parameters.Add(P);

            MySqlDataReader Lire = cmd.ExecuteReader();

            Console.WriteLine(" Code        Titre                   DS          Examen          Moyenne");
            while (Lire.Read())
            {
                Console.WriteLine("  " + code + "           " + Lire["Intitule"].ToString() + "                    " + Lire.GetDouble("DS") + "            " + Lire.GetDouble("Examen") + "            " + ExamenDAL.GetMoyenneModule(Num));
                code++;
            }

            Lire.Close();
        }
Beispiel #6
0
        public static void En_Tete(int Num)
        {
            cmd = new MySqlCommand(" Select * from etudiant where NumInscription = ?", Connexion.Connect());
            MySqlParameter P = new MySqlParameter("NumInscription", Num);

            cmd.Parameters.Add(P);

            MySqlDataReader Lire = cmd.ExecuteReader();

            while (Lire.Read())
            {
                Console.WriteLine(" Num inscription : " + Lire.GetDouble("NumInscription"));
                Console.WriteLine(" Nom : " + Lire.GetString("Nom"));
                Console.WriteLine(" Date de naissance : " + Lire.GetString("DateNaissance"));
            }

            Lire.Close();
        }