private void Profil_Load_1(object sender, System.EventArgs e) { Task.Run(() => { Task <string> result = Requetes.GetInfo(Properties.Settings.Default.SERVER.ToString() + "/Utilisateur/GetById/" + id); JObject json = JObject.Parse(result.Result); this.Invoke(new MethodInvoker(delegate { mail_value.Text = json["MAIL"].ToString(); pseudo_value.Text = json["PSEUDO"].ToString(); pictureBox1.Image = Inscription.BytetoImage(Convert.FromBase64String(json["AVATAR"].ToString())); })); }); }
private void button1_Click(object sender, EventArgs e) { if (linkTxt.Text != "" && mdp_value.Text != "") { Task.Run(() => { Task <string> result = UpdateAvatar(id, mdp_value.Text, Inscription.ImagetoByte(linkTxt.Text)); this.Invoke(new MethodInvoker(delegate { MessageBox.Show(result.Result); })); }); } else { MessageBox.Show("Champs vide"); } }
private void button1_Click(object sender, EventArgs e) { if (mdp.Text != "" && mail.Text != "" && Inscription.IsValidEmail(mail.Text)) { Task.Run(() => { Task <string> result = Requetes.PostInfo(Properties.Settings.Default.SERVER + "/Utilisateur/UpdateUtilisateur", new List <AttributeModel> { new AttributeModel("mdp", mdp.Text), new AttributeModel("id", id), new AttributeModel("newMail", mail.Text), }); this.Invoke(new MethodInvoker(delegate { this.Close(); })); }); } else { MessageBox.Show("Champs vide"); } }