private void Button_Click(object sender, RoutedEventArgs e) { Clients c = new Clients(); c.nom = Nom.Text; c.prenom = Prenom.Text; c.numero_telephone = Numero.Text; c.adresse = Adresse.Text; clientService.Ajouter(c); }
private void Valider_Click(object sender, RoutedEventArgs e) { if (tb_Adresse.Text == "" || tb_Nom.Text == "" || tb_Numero.Text == "" || tb_Prenom.Text == "") { return; } Client newClient = new Client { nom = tb_Nom.Text, prenom = tb_Prenom.Text, adresse = tb_Adresse.Text, numero = tb_Numero.Text }; clientService.Ajouter(newClient); Clients = clientService.GetAll(); dg_clients.ItemsSource = Clients; dg_clients.Items.Refresh(); tb_Prenom.Text = tb_Nom.Text = tb_Adresse.Text = tb_Numero.Text = ""; }