private void buttonModificar_Click(object sender, EventArgs e) { contacte c = new contacte(); c.contacteId = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); c.nom = textBoxNom.Text; c.cognoms = textBoxCognom.Text; repo.UpdateContacte(c); dataGridView1.DataSource = repo.GetAllContactes(); }
private void buttonAfegir_Click(object sender, EventArgs e) { contacte c = new contacte(); c.nom = textBoxNom.Text; c.cognoms = textBoxCognom.Text; c.telefons = new List <telefon>(); c.emails = new List <email>(); repo.InsertContacte(c); dataGridView1.DataSource = repo.GetAllContactes(); }
public contacte InsertContacte(contacte c2Add) { contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacte/"), c2Add, "POST", "application/json", typeof(contacte)); return(c); }
public contacte UpdateContacte(contacte c2Upd) { contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacte/", c2Upd.contacteId), c2Upd, "PUT", "application/json", typeof(contacte)); return(c); }
public contacte GetContacte(int id) { contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacteTot/", id), null, "GET", "application/json", typeof(contacte)); return(c); }