示例#1
0
 public void ModifierContact(String token, FullContact fc)
 {
     json                  = JsonConvert.SerializeObject(fc);
     httpWebRequest        = (HttpWebRequest)WebRequest.Create(uri + "users/contacts/" + fc.id);
     httpWebRequest.Method = "PUT";
     httpWebRequest.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + token);
     EnvoyerJson();
 }
示例#2
0
        public void AjouterContact(String token, FullContact fc)
        {
            json = JsonConvert.SerializeObject(fc);
            // Suppression de l'id dans le json
            var o = (Newtonsoft.Json.Linq.JObject)JsonConvert.DeserializeObject(json);

            json = o.ToString();

            httpWebRequest        = (HttpWebRequest)WebRequest.Create(uri + "users/contacts");
            httpWebRequest.Method = "POST";
            httpWebRequest.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + token);
            EnvoyerJson();
        }
示例#3
0
        private void FenContact_Load(object sender, EventArgs e)
        {
            maRequete.RecupererContact(monFlux.token, idContact);

            String json = maRequete.GetResult();

            monContact = JsonConvert.DeserializeObject <FullContact>(json);

            lbNom.Text        = monContact.first_name;
            lbPrenom.Text     = monContact.last_name;
            lbEmail.Text      = monContact.email;
            lbTelephone.Text  = monContact.phone;
            cbFavoris.Checked = monContact.favorite;
        }
示例#4
0
        private void FormContact_Load(object sender, EventArgs e)
        {
            if (idContact != 0)
            {
                maRequete.RecupererContact(monFlux.token, idContact);

                String json = maRequete.GetResult();
                monContact = JsonConvert.DeserializeObject <FullContact>(json);

                tbNom.Text        = monContact.first_name;
                tbPrenom.Text     = monContact.last_name;
                tbEmail.Text      = monContact.email;
                tbTelephone.Text  = monContact.phone;
                cbFavoris.Checked = monContact.favorite;

                btnModifier.Visible = true;
            }
            else
            {
                btnAjouter.Visible = true;
            }
        }