private void SendRegisterForm(RegisterContent content) { if (!ConnectionClass.ClientTCP.isconnected) { //SetGif(false, true); MessageBox.Show("Sunteti momentan offline", "Tiroida"); return; } string jsonstring = JsonConvert.SerializeObject(content); if (!ConnectionClass.ClientTCP.isconnected) { ConnectionClass.ClientTCP.OnRegisterResponse += ClientTCP_OnRegisterResponse; ConnectionClass.ClientTCP.SendContent(jsonstring); } }
private void metroButton2_Click(object sender, EventArgs e) { if (this.metroTextBox1.Text.Length < 3) { MessageBox.Show("Numele de utilizator este prea scurt", "Tiroida"); return; } if (!ValidEmail(this.metroTextBox4.Text)) { MessageBox.Show("Email invalid", "Tiroida"); return; } if (this.metroTextBox2.Text == this.metroTextBox3.Text) { if (this.metroButton2.Text.Length < 3) { MessageBox.Show("Parola este prea scurta", "Tiroida"); return; } RegisterContent content = new RegisterContent(this.metroTextBox1.Text, this.metroTextBox2.Text, this.metroTextBox4.Text); Thread t1 = new Thread(() => SendRegisterForm(content)); t1.Start(); } else { MessageBox.Show("Parola nu coincide!", "Tiroida"); } }