Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        public contacte InsertContacte(contacte c2Add)
        {
            contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacte/"), c2Add, "POST", "application/json", typeof(contacte));

            return(c);
        }
Пример #4
0
        public contacte UpdateContacte(contacte c2Upd)
        {
            contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacte/", c2Upd.contacteId), c2Upd, "PUT", "application/json", typeof(contacte));

            return(c);
        }
Пример #5
0
        public contacte GetContacte(int id)
        {
            contacte c = (contacte)MakeRequest(string.Concat(ws1, "contacteTot/", id), null, "GET", "application/json", typeof(contacte));

            return(c);
        }