private void radButton_Click(object sender, RoutedEventArgs e) { try { etudiant etud = new etudiant(); etud = radform.CurrentItem as etudiant; var x = (from c in ListerFiliers.cl.etudiant where c.cne == etud.cne select c).Single(); x.nom = etud.nom; x.prenom = etud.prenom; x.adresse = etud.adresse; x.date_naiss = etud.date_naiss; x.sexe = etud.sexe; x.telephone = etud.telephone; x.Filiere.Nom_filiere = etud.Filiere.Nom_filiere; if (image != "" && image != null) { x.image = image; } ListerFiliers.cl.SubmitChanges(); MessageBox.Show("validated!"); } catch (Exception ex) { MessageBox.Show("une erreu est survenue"); } }
private void search_SelectionChanged(object sender, SelectionChangedEventArgs e) { etudiant filiere = (etudiant)search.SelectedItem; string datecre = filiere.Filiere.date_creation.ToString(); DateTime date = Convert.ToDateTime(datecre); infosup.Content = filiere.Filiere.Nom_filiere + "\n responsable : " + filiere.Filiere.responsable + "\n date de création : " + date.ToShortDateString(); //trier datagridview ListerFiliers.MyItems = new ObservableCollection <etudiant>((from c in ListerFiliers.cl.etudiant where c.Filiere.Nom_filiere == filiere.Filiere.Nom_filiere select c).ToList()); filter.Operator = FilterOperator.Contains; filter.Value = filiere.Filiere.Nom_filiere; filter.Member = "Filiere.Nom_Filiere"; this.GridData.FilterDescriptors.Add(filter); }
private void detach_etudiant(etudiant entity) { this.SendPropertyChanging(); entity.Filiere = null; }
private void attach_etudiant(etudiant entity) { this.SendPropertyChanging(); entity.Filiere = this; }
partial void Deleteetudiant(etudiant instance);
partial void Updateetudiant(etudiant instance);
partial void Insertetudiant(etudiant instance);
private void GridData_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) { etudiant etudiant = (etudiant)GridData.SelectedItem; id = Convert.ToInt32(etudiant.cne); }