Ejemplo n.º 1
0
        public static void Inserer()
        {
            Etudiant E = PRL.SaisirEtudiant();

            cmd = new OleDbCommand(" Insert into Etudiant values (?,?,?) ", DBconnection.cnn);
            cmd.Parameters.Add(new OleDbParameter("NumInscription", E.NumInscription));
            cmd.Parameters.Add(new OleDbParameter("Nom", E.Nom));
            cmd.Parameters.Add(new OleDbParameter("DateNaiss", E.DateNaiss));

            cmd.ExecuteNonQuery();
        }
Ejemplo n.º 2
0
        public static Etudiant SaisirEtudiant()
        {
            Etudiant E = new Etudiant();

            Console.WriteLine(" Numero d'inscription : ");
            E.NumInscription = int.Parse(Console.ReadLine());
            Console.WriteLine(" Nom : ");
            E.Nom = Console.ReadLine();
            Console.WriteLine(" Date de naissance : ");
            E.DateNaiss = DateTime.Parse(Console.ReadLine());

            return(E);
        }
Ejemplo n.º 3
0
        public static Etudiant GetEtudiant(int numIns)
        {
            cmd = new OleDbCommand("Select* from Etudiant where NumInscription = ?", DBconnection.cnn);
            cmd.Parameters.Add(new OleDbParameter("NumInscription", numIns));
            OleDbDataReader rt       = cmd.ExecuteReader();
            Etudiant        etudiant = new Etudiant();

            while (rt.Read())
            {
                etudiant.NumInscription = int.Parse(rt["NumInscription"].ToString());
                etudiant.Nom            = rt["Nom"].ToString();
                etudiant.DateNaiss      = DateTime.Parse(rt["DateNaiss"].ToString());
            }
            return(etudiant);
        }