private void Button_Click_1(object sender, RoutedEventArgs e) { etudiant et = Dataform.CurrentItem as etudiant; EtudiantOperation f = new EtudiantOperation(); f.modifier(et); }
public void dataForm_DeletingItem(object sender, System.ComponentModel.CancelEventArgs e) { etudiant et = Dataform.CurrentItem as etudiant; EtudiantOperation f = new EtudiantOperation(); f.Delete(et.cne.ToString()); }
//modifier public void modifier(etudiant etudiant) { var x = (from f in cl.etudiants where f.cne == etudiant.cne select f).SingleOrDefault(); x.nom = etudiant.nom; x.prenom = etudiant.prenom; x.dateNaiss = etudiant.dateNaiss; cl.SubmitChanges(); }
//ajouterr public void ajouter(etudiant etudiant) { List <etudiant> Listeetudiant = new List <etudiant>(); etudiant f = new etudiant(); f.cne = etudiant.cne; f.nom = etudiant.nom; f.prenom = etudiant.prenom; f.dateNaiss = etudiant.dateNaiss; // f.date_naiss = date_naiss; cl.etudiants.InsertOnSubmit(f); cl.SubmitChanges(); Listeetudiant.Add(f); }
//pour recuperer les donnee dans le Raddatafrom public List <etudiant> geAlleudiant() { List <etudiant> Listeetudiant = new List <etudiant>(); var x = from c in cl.etudiants select new { c.cne, c.nom, c.prenom, c.dateNaiss }; foreach (var y in x) { etudiant et = new etudiant(); et.cne = y.cne; et.nom = y.nom; et.prenom = y.prenom; et.dateNaiss = y.dateNaiss; Listeetudiant.Add(et); } return(Listeetudiant); }
//affiher pour chaque combobox public List <etudiant> getchaquefiliere(String v) { GestionEtudiant ft = new GestionEtudiant(); List <etudiant> Listeetudiant = new List <etudiant>(); var x = (from c in cl.etudiants join d in cl.filieres on c.id_filiere equals d.id_filiere where d.nom_filiere == v select new { c.cne, c.nom, c.prenom, c.dateNaiss, c.tof }); foreach (var y in x) { etudiant et = new etudiant(); et.cne = y.cne; et.nom = y.nom; et.prenom = y.prenom; et.dateNaiss = y.dateNaiss; et.tof = y.tof; Listeetudiant.Add(et); } return(Listeetudiant); }
partial void Deleteetudiant(etudiant instance);
partial void Updateetudiant(etudiant instance);
partial void Insertetudiant(etudiant instance);