public List <Stagiaire> Select() { List <Stagiaire> ListStagiaires = new List <Stagiaire>(); String Requete = "Select * from Stagiaires where etat =1"; OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Stagiaire s = new Stagiaire(); s.Id = read.GetInt32(0); s.Filiere = new FiliereDAO().FindById(read.GetInt32(1)); s.Nom = (string)read["Nom"]; s.Prenom = (string)read["Prenom"]; s.DateNaissance = (DateTime)read["DateNaissance"]; s.Sexe = read.GetBoolean(5); s.Cin = read.GetString(6); s.Email = read.GetString(7); s.Telephone = read.GetString(8); s.Adresse = read.GetString(9); s.ProfilImage = read.GetString(10); s.Etat = read.GetInt32(11); ListStagiaires.Add(s); } return(ListStagiaires); }
public List <Stagiaire> SelectNotConfirm() { List <Stagiaire> ListStagiaires = new List <Stagiaire>(); String Requete = "Select * from Stagiaires where etat =0"; OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Stagiaire s = new Stagiaire(); s.Id = read.GetInt32(0); s.Nom = read.GetString(1); s.Prenom = read.GetString(2); s.DateNaissance = read.GetDateTime(3); s.Sexe = read.GetBoolean(4); s.Cin = read.GetString(5); s.Email = read.GetString(6); s.Telephone = read.GetString(7); s.Adresse = read.GetString(8); s.ProfilImage = read.GetString(9); s.Etat = read.GetInt32(10); s.Groupe = new GroupeDAO().FindById(read.GetInt32(11)); ListStagiaires.Add(s); } return(ListStagiaires); }
public List <Groupe> FindByGroup(Groupe g) { string Requete = "Select * from Groupes "; if (g.Code != "" || g.Nom != "" || g.Description != "" || g.Filiere.Titre != "") { Requete += " where "; } bool and = false; if (g.Code != "") { Requete += " Code like '%" + g.Code + "%'"; and = true; } if (g.Nom != "") { if (and) { Requete += " and "; } Requete += " Nom like '%" + g.Nom + "%'"; and = true; } if (g.Description != "") { if (and) { Requete += " and "; } Requete += " Description like '%" + g.Description + "%'"; and = true; } if (g.Filiere.Titre != "") { if (and) { Requete += " and "; } Requete += " IdFiliere like '%" + g.Filiere.Id + "%'"; and = true; } List <Groupe> ListGroupe = new List <Groupe> (); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Groupe gr = new Groupe(); gr.Id = read.GetInt32(0); gr.Nom = read.GetString(1); gr.Code = read.GetString(2); gr.Description = read.GetString(3); gr.Filiere = new FiliereDAO().FindById(read.GetInt32(4)); ListGroupe.Add(gr); } MyConnection.Close(); return(ListGroupe); }
public Filiere FindByName(string Name) { string Requete = "Select * from Filieres where Nom=" + Name; OleDbDataReader read = MyConnection.ExecuteReader(Requete); Filiere f = new Filiere(); f.Id = read.GetInt32(0); f.Code = read.GetString(1); f.Titre = read.GetString(2); return(f); }
public Formation FindById(int id) { string Requete = "Select * from Formations where id=" + id; OleDbDataReader read = MyConnection.ExecuteReader(Requete); Formation g = new Formation(); read.Read(); g.Id = read.GetInt32(0); MyConnection.Close(); return(g); }
public List <AnneeFormation> select() { List <AnneeFormation> lstanneformation = new List <AnneeFormation>(); string rqt = "select *from AnneeFormations"; OleDbDataReader lire = MyConnection.ExecuteReader(rqt); while (lire.Read()) { lstanneformation.Add(new AnneeFormation(lire.GetInt32(0), lire.GetString(1), lire.GetDateTime(2), lire.GetDateTime(3))); } return(lstanneformation); }
public Module getModulepre(int id) { List <Module> m = new List <Module>(); string req = "Select * from [Module] where id = " + id; OleDbDataReader da = MyConnection.ExecuteReader(req); while (da.Read()) { m.Add(new Module(da.GetInt32(0), new PackageFilieres.FiliereDAO().FindById(da.GetInt32(1)), da.GetString(2), da.GetInt32(3), da.GetString(4), da.GetString(5), da.GetString(6), da.GetString(7), da.GetString(8), da.GetString(9), da.GetString(10), da.GetString(11), da.GetString(12))); } MyConnection.Close(); return(m.ElementAt(0)); }
public List <Precision> GetallPres(int id) { List <Precision> p = new List <Precision>(); string req = "Select * From [Precisions] where modules_id =" + id; OleDbDataReader sqr = MyConnection.ExecuteReader(req); while (sqr.Read()) { p.Add(new Precision(sqr.GetInt32(0), sqr.GetInt32(1), sqr.GetString(2), sqr.GetString(3), sqr.GetInt32(4), sqr.GetInt32(5), new ModuleDAO().FindById(sqr.GetInt32(6)))); } MyConnection.Close(); return(p); }
public Filiere FindById(int id) { string Requete = "Select * from Filieres where id=" + id; OleDbDataReader read = MyConnection.ExecuteReader(Requete); read.Read(); Filiere f = new Filiere(); f.Id = read.GetInt32(0); f.Code = read.GetString(1); f.Titre = read.GetString(2); return(f); }
/// <summary> /// Recherche par Code, Titre, et Description /// </summary> /// <param name="filier"></param> /// <returns></returns> public List <Filiere> FindByFilier(Filiere filier) { string Requete = "Select * from Filieres "; if (filier.Code != "" || filier.Titre != "" || filier.Description != "") { Requete += " where "; } bool and = false; if (filier.Code != "") { Requete += " Code like '%" + filier.Code + "%'"; and = true; } if (filier.Titre != "") { if (and) { Requete += " and "; } Requete += " Titre like '%" + filier.Titre + "%'"; and = true; } if (filier.Description != "") { if (and) { Requete += " and "; } Requete += " Description like '%" + filier.Description + "%'"; and = true; } List <Filiere> ListFiliere = new List <Filiere>(); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Filiere f = new Filiere(); f.Id = read.GetInt32(0); f.Titre = read.GetString(1); f.Code = read.GetString(2); f.Description = read.GetString(3); ListFiliere.Add(f); } MyConnection.Close(); return(ListFiliere); }
public Seanceplanning FindById(int id) { string Requete = "Select * from SeancePlannings where id=" + id; OleDbDataReader read = MyConnection.ExecuteReader(Requete); read.Read(); Seanceplanning f = new Seanceplanning(); f.Id = read.GetInt32(0); f.Jour = read.GetString(1); f.Heuredebut = read.GetInt32(2); f.Heurefin = read.GetInt32(3); return(f); }
public List <Module> Select() { List <Module> liste = new List <Module>(); string req = "select * from Modules"; OleDbDataReader da = MyConnection.ExecuteReader(req); while (da.Read()) { liste.Add(new Module(da.GetInt32(0), new PackageFilieres.FiliereDAO().FindById(da.GetInt32(1)), da.GetString(2), da.GetInt32(3), da.GetString(4), da.GetString(5), da.GetString(6), da.GetString(7), da.GetString(8), da.GetString(9), da.GetString(10), da.GetString(11), da.GetString(12))); } MyConnection.Close(); return(liste); }
public Groupe FindById(int id) { string Requete = "Select * from Groupes where id=" + id; OleDbDataReader read = MyConnection.ExecuteReader(Requete); Groupe g = new Groupe(); read.Read(); g.Id = read.GetInt32(0); g.Code = read.GetString(1); g.Nom = read.GetString(2); g.Filiere = new FiliereDAO().FindById(read.GetInt32(3)); MyConnection.Close(); return(g); }
public List <Precision> Select() { List <Precision> p = new List <Precision>(); string req = "Select * From Precisions"; OleDbDataReader sqr = MyConnection.ExecuteReader(req); while (sqr.Read()) { p.Add(new Precision(sqr.GetInt32(0), sqr.GetInt32(1), sqr.GetString(2), sqr.GetString(3), sqr.GetInt32(4), sqr.GetInt32(5), new ModuleDAO().FindById(sqr.GetInt32(6)))); // p.Add(new Precision(sqr.GetInt32(0), sqr.GetInt32(1), sqr.GetString(2), sqr.GetString(3), sqr.GetInt32(4), sqr.GetInt32(5),new ModuleDAO().FindById(sqr.GetInt32(6)))); } MyConnection.Close(); return(p); }
public IEnumerable <IncrementationDB> SelectFromDB() { List <IncrementationDB> listIncrementationDB = new List <IncrementationDB>(); string query = "Select * from VersionDB"; OleDbDataReader listeRox = MyConnection.ExecuteReader(query); while (listeRox.Read()) { IncrementationDB incrementationDB = new IncrementationDB(); incrementationDB.Code = (string)listeRox["Version"]; listIncrementationDB.Add(incrementationDB); } return(listIncrementationDB); }
public List <Formation> select() { List <Formation> listformation = new List <Formation>(); string reqeute = "select * from Formations"; OleDbDataReader lire = MyConnection.ExecuteReader(reqeute); while (lire.Read()) { listformation.Add(new Formation(1)); } return(listformation); }
public EmploisTemp FindById(int id) { string Requete = "Select * from EmploisTemps where id=" + id; OleDbDataReader read = MyConnection.ExecuteReader(Requete); read.Read(); EmploisTemp f = new EmploisTemp(); f.Id = read.GetInt32(0); f.DateDebut = read.GetDateTime(1); f.DateFin = read.GetDateTime(2); // f.Anneeformation = read.GetDateTime(3); return(f); }
public List <Module> findbyname(Module m) { string req = "select * from [modules]"; if (m.Nom != "" || m.Description != "" || m.Id_f.Id != 0 || m.Duree != 0) { req += " where "; } bool and = false; if (m.Nom != "") { req += " nom like '%" + m.Nom + "%'"; and = true; } if (m.Id_f.Id != 0) { req += " and Filiere_id like '%" + m.Id_f.Id + "%'"; and = true; } if (m.Description != null) { if (and) { req += " and description like '%" + m.Description + "%'"; } and = true; } if (m.Duree != null) { if (and) { req += " and duree like " + m.Duree; } } List <Module> liste = new List <Module>(); OleDbDataReader da = MyConnection.ExecuteReader(req); while (da.Read()) { liste.Add(new Module(da.GetInt32(0), new PackageFilieres.FiliereDAO().FindById(da.GetInt32(1)), da.GetString(2), da.GetInt32(3), da.GetString(4), da.GetString(5), da.GetString(6), da.GetString(7), da.GetString(8), da.GetString(9), da.GetString(10), da.GetString(11), da.GetString(12))); } return(liste); }
public List <Groupe> Select() { string Requete = "Select * from Groupes"; List <Groupe> ListGroupe = new List <Groupe>(); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Groupe g = new Groupe(); g.Id = read.GetInt32(0); g.Code = read.GetString(1); g.Nom = read.GetString(2); ListGroupe.Add(g); } MyConnection.Close(); return(ListGroupe); }
public List <Filiere> Select() { string Requete = "Select * from Filieres"; List <Filiere> ListFiliere = new List <Filiere>(); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Filiere f = new Filiere(); f.Id = read.GetInt32(0); f.Code = read.GetString(1); f.Nom = read.GetString(2); ListFiliere.Add(f); } MyConnection.Close(); return(ListFiliere); }
public List <EmploisTemp> Select() { string Requete = "Select * from EmploisTemps"; List <EmploisTemp> ListEmploisTemp = new List <EmploisTemp>(); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { EmploisTemp f = new EmploisTemp(); f.Id = read.GetInt32(0); f.DateDebut = read.GetDateTime(1); f.DateFin = read.GetDateTime(2); // f.Anneeformation = read.GetDateTime(3); ListEmploisTemp.Add(f); } MyConnection.Close(); return(ListEmploisTemp); }
public List <Seanceplanning> Select() { string Requete = "Select * from SeancePlannings"; List <Seanceplanning> ListSeancePlannings = new List <Seanceplanning>(); OleDbDataReader read = MyConnection.ExecuteReader(Requete); while (read.Read()) { Seanceplanning f = new Seanceplanning(); f.Id = read.GetInt32(1); f.Jour = read.GetString(2); f.Heuredebut = read.GetInt32(3); f.Heurefin = read.GetInt32(4); f.Formation = new PackageFormations.FormationDAO().FindById(read.GetInt32(5)); ListSeancePlannings.Add(f); } MyConnection.Close(); return(ListSeancePlannings); }