private void buttonModifier_Click(object sender, EventArgs e) { if (user == null || dataGridView1.CurrentRow == null) { return; } Template template = GestionContacts.GetTemplate(ApiContact.GetStringJSonTemplate(user)); if (template != null && ListeContacts != null) { DelegateChargerListeContact d = ChargerListeContacts; long idcontact = long.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()); if (ListeContacts != null) { Contact c = ListeContacts.Where(x => x.getIdcontact() == idcontact).FirstOrDefault(); if (c != null) { FicheContactForm w = new FicheContactForm(template, user.getIduser(), d, c); w.ShowDialog(); } } } }
private void buttonAjouter_Click(object sender, EventArgs e) { if (user == null) { return; } Template template = GestionContacts.GetTemplate(ApiContact.GetStringJSonTemplate(user)); if (template != null) { DelegateChargerListeContact d = ChargerListeContacts; FicheContactForm w = new FicheContactForm(template, user.getIduser(), d); w.ShowDialog(); } }