private void boutonAjouter_Click(object sender, RoutedEventArgs e) { Salarie sal = new Salarie() { NumSalarie = "7896", Nom = "coucou", Prenom = "test" }; DataBase.Salaries.Add(sal); }
private void Button_Click(object sender, RoutedEventArgs e) { Salarie sal = new Salarie() { NumSalarie = "1234", Nom = "toto", Prenom = "titi" }; if (!DataBase.Salaries.Contains(sal)) { DataBase.Salaries.Add(sal); } }
public override bool Equals(object obj) { Salarie sal = obj as Salarie; if (sal == null) { return(false); } else { return(Equals(sal)); } }
public bool Equals(Salarie sal) { return(this.NumSalarie == sal.NumSalarie); }