Example #1
0
        private void linkLogout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Visible = false;
            Form_Login fr1 = new Form_Login();

            fr1.ShowDialog();
        }
Example #2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string query =
                "insert into siswa(NIS, nama, email, jurusan, kelas, password, no_hp, ttl, motto, alamat)" +
                " values ('" + tbNIS.Text + "', '" + tbNama.Text + "', '" + tbEmail.Text + "', '" +
                cbJurusan.Text + "', '" + cbKelas.Text + "','" + tbPass.Text + "', '" + tbNo.Text + "', " +
                "'" + dateTimePicker1.Value.Date.ToString("yyyyMMdd") + "', '" + tbMotto.Text + "', '" + tbAlamat.Text + "') ;";
            MySqlDataReader reader;

            Form_Login f1 = new Form_Login();

            try
            {
                connect.Open();
                MySqlCommand SQLCommand = new MySqlCommand(query, connect);

                if (tbNIS.TextLength > 5)
                {
                    MessageBox.Show("Panjang NIS tidak boleh lebih dari 5");
                }
                else if (tbNIS.Text.Equals("") || tbNama.Text.Equals("") || tbEmail.Equals("") || cbJurusan.Text.Equals("") ||
                         cbKelas.Text.Equals("") || tbPass.Text.Equals("") || tbNo.Text.Equals("") || tbMotto.Text.Equals("") ||
                         tbAlamat.Text.Equals(""))
                {
                    MessageBox.Show("Data harus terisi semua");
                }
                else
                {
                    reader = SQLCommand.ExecuteReader();
                    this.Dispose();
                    f1.ShowDialog();
                }
                //MessageBox.Show("Connected");*/
                connect.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("NIS sudah memiliki akun");
            }
        }
Example #3
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     this.Dispose();
     f1.ShowDialog();
 }