private void button2_Click(object sender, EventArgs e)
 {
     MessageBox.Show("Please check your E-mail!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
     login = new Loginpage();
     login.Show();
     this.Hide();
 }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (Deletestudent(tbemail.Text, tbpass.Text) == true)
     {
         MessageBox.Show("Your Account is Deleted");
         login = new Loginpage();
         login.Show();
         this.Hide();
     }
 }
        private void button2_Click(object sender, EventArgs e)
        {
            koneksi();
            String       s   = "SELECT nis FROM student where nis = '" + tbnis.Text + "'";
            MySqlCommand c   = new MySqlCommand(s, conn);
            Object       r   = c.ExecuteScalar();
            String       nis = (String)r;

            String       sq    = "SELECT email FROM student where email = '" + tbemail.Text + "'";
            MySqlCommand cm    = new MySqlCommand(sq, conn);
            Object       re    = cm.ExecuteScalar();
            String       email = (String)re;

            if (nis == tbnis.Text)
            {
                MessageBox.Show("NIS ALREADY USED");
            }
            else if (email == tbemail.Text)
            {
                MessageBox.Show("Email ALREADY USED");
            }
            else if (tbpass.Text != tbpass1.Text)
            {
                MessageBox.Show("Your Password and Reapeat Password Doesn't Same");
            }
            else
            {
                String       sql  = "INSERT INTO student values ('" + tbnis.Text + "','" + tbname.Text + "','" + tbemail.Text + "','" + tbpass.Text + "','" + tbphone.Text + "')";
                MySqlCommand cmd1 = new MySqlCommand(sql, conn);
                cmd1.ExecuteNonQuery();
                //buat tabel forgot password jika akunnya student
                String       sql2 = "INSERT INTO forgot_student values('" + tbnis.Text + "','" + tbquestion.Text + "','" + tbanswer.Text + "')";
                MySqlCommand cmd2 = new MySqlCommand(sql2, conn);
                cmd2.ExecuteNonQuery();
                MessageBox.Show("Your Account Save");
                login = new Loginpage();
                login.Show();
                this.Hide();
            }
            conn.Close();
        }
 private void label7_Click_1(object sender, EventArgs e)
 {
     login = new Loginpage();
     login.Show();
     this.Hide();
 }
Exemplo n.º 5
0
 private void button3_Click(object sender, EventArgs e)
 {
     login = new Loginpage();
     login.Show();
     this.Hide();
 }
        private void btnsignup_Click(object sender, EventArgs e)
        {
            String jeniskelamin = "";
            if (rdlaki.Checked)
            {
                jeniskelamin = "Male";
            }
            else if (rdperempuan.Checked)
            {
                jeniskelamin = "Female";
            }

            koneksi();
            String s = "SELECT nik FROM teacher where nik = '" + tbnik.Text + "'";
            MySqlCommand c = new MySqlCommand(s, conn);
            Object r = c.ExecuteScalar();
            String nis = (String)r;

            String sq = "SELECT email FROM teacher where email = '" + tbemail.Text + "'";
            MySqlCommand cm = new MySqlCommand(sq, conn);
            Object re = cm.ExecuteScalar();
            String email = (String)re;

            String user = "******" + tbUser.Text + "'";
            MySqlCommand cmd = new MySqlCommand(user, conn);
            Object user1 = cmd.ExecuteScalar();
            String username = (String)user1;

            if (nis == tbnik.Text)
            {
                MessageBox.Show("NIK ALREADY USED");
            }
            else if (email == tbemail.Text)
            {
                MessageBox.Show("Email ALREADY USED");
            }

            else if (tbpass.Text != tbpass1.Text)
            {
                MessageBox.Show("Your Password and Reapeat Password Doesn't Same");
            }
            else if (username == tbUser.Text)
            {
                MessageBox.Show("Username Already Used");
            }
            else
            {
                String sql = "INSERT INTO teacher values ('" + tbnik.Text + "','" + tbName.Text + "','" + tbUser.Text + "','" + tbemail.Text + "','" + tbpass.Text + "','" + tbphone.Text + "','" + jeniskelamin + "')";
                MySqlCommand cmd1 = new MySqlCommand(sql, conn);
                cmd1.ExecuteNonQuery();
                //buat tabel forgot password jika akunnya teacher
                String sql2 = "INSERT INTO forgot_teacher values('" + tbnik.Text + "','" + question.Text + "','" + tbanswer.Text + "')";
                MySqlCommand cmd2 = new MySqlCommand(sql2, conn);
                cmd2.ExecuteNonQuery();
                MessageBox.Show("Your Account Save");
                login = new Loginpage();
                login.Show();
                this.Hide();
            }
            conn.Close();
        }