Exemplo n.º 1
0
 private void enregistrer(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(contact.Text))
     {
         eror.Visibility = System.Windows.Visibility.Visible;
     }
     else
     {
         methodes save           = new methodes();
         int      id_new_contact = save.save_contact(contact.Text, adr.Text, tlphn.Text, mail.Text, site.Text, this.id_user);
         contact  new_con        = new contact(id_new_contact, contact.Text, adr.Text, tlphn.Text, mail.Text, site.Text, this.id_user);
         page.add_tolist(new_con);
         page.clear_listbox();
         page.afficher(page.get_list());
         Close();
     }
 }
Exemplo n.º 2
0
 private void enregistrer(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(contact.Text))
     {
         eror.Visibility = System.Windows.Visibility.Visible;
     }
     else
     {
         methodes       save_changes = new methodes();
         List <contact> list         = page.get_list();
         save_changes.modif_contact(list[pos], contact.Text, adr.Text, tlphn.Text, mail.Text, site.Text);
         list[pos].set_name(contact.Text);
         list[pos].set_adr(adr.Text);
         list[pos].set_num(tlphn.Text);
         list[pos].set_mail(mail.Text);
         list[pos].set_site(site.Text);
         page.clear_listbox();
         page.afficher(list);
         this.Close();
     }
 }