private void txtNoHp_Leave(object sender, EventArgs e) { if (txtNoHp.Text != string.Empty) { bool isNohp = MainControllClass.isNumber(txtNoHp.Text); hideWarning(isNohp, warningNoHP); } }
private async void cekFormDaftar() { bool email = txtEmail.Text != string.Empty && MainControllClass.isEmail(txtEmail.Text); bool username = txtUsernameDaftar.Text != string.Empty; bool password = txtPasswordDaftar.Text != string.Empty && txtRepasswordDaftar.Text != string.Empty && txtRepasswordDaftar.Text == txtPasswordDaftar.Text; if (email && username && password) { try { if (cbGender.Text.Equals("Laki-Laki")) { gender = "0"; } else { gender = "1"; } if (await koneksi.konekDB()) { var inputData = new Dictionary <string, string> { { "nama", txtNama.Text }, { "email", txtEmail.Text }, { "gender", gender }, { "username", txtUsernameDaftar.Text }, { "password", txtPasswordDaftar.Text }, { "repassword", txtRepasswordDaftar.Text } }; var postData = await Connection.postApi(inputData, "/daftar"); var hasil = JsonConvert.DeserializeObject <Dictionary <string, string> >(postData); if (hasil["status"] == "ok") { MessageBox.Show($@"Anda berhasil terdaftar!\n{hasil["result"]}", "Berhasil!", MessageBoxButtons.OK, MessageBoxIcon.Information); /*this.Hide(); * Home home = new Home(); * home.Show();*/ } else { MessageBox.Show($@"{hasil["result"]}", "Gagal!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception e) { MessageBox.Show(e.ToString()); } } btnDaftar.Enabled = true; btnDaftar.UseWaitCursor = false; }
private void btnADBTool_Click(object sender, EventArgs e) { Form fc = Application.OpenForms["ADB"]; if (fc == null) { adb = new ADB(); MainControllClass.showControl(adb, plIsi); } else { adb.Show(); } }
private void btnFastBoot_Click(object sender, EventArgs e) { Form fc = Application.OpenForms["FastBoot"]; if (fc == null) { fastBoot = new FastBoot(); MainControllClass.showControl(fastBoot, plIsi); } else { fastBoot.Show(); } }
private void btnNordVPN_Click(object sender, EventArgs e) { Form fc = Application.OpenForms["NordVPN"]; if (fc == null) { nordVpn = new NordVPN(); MainControllClass.showControl(nordVpn, plIsi); } else { nordVpn.Show(); } }
private void txtEmail_Leave(object sender, EventArgs e) { bool isMail = MainControllClass.isEmail(txtEmail.Text); hideWarning(isMail, warningEmail); }