Exemple #1
0
        private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            PeminjamanAdmin peminjamanAdmin = new PeminjamanAdmin();

            this.Hide();
            peminjamanAdmin.Show();
        }
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            MySqlConnection con = new MySqlConnection(connectionString);

            i = 0;
            con.Open();
            MySqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from user where username='******' and password='******'";
            cmd.ExecuteNonQuery();
            DataTable        dt      = new DataTable();
            MySqlDataAdapter dataset = new MySqlDataAdapter(cmd);

            dataset.Fill(dt);
            i = Convert.ToInt32(dt.Rows.Count.ToString());

            if (i == 0)
            {
                MessageBox.Show("Username dan Password invalid!");
            }
            else
            {
                if (bunifuMaterialTextbox1.Text.Equals("admin"))
                {
                    this.Hide();
                    PeminjamanAdmin peminjamanAdmin = new PeminjamanAdmin();
                    peminjamanAdmin.Show();
                }
                else
                {
                    this.Hide();
                    LamanUser frm2 = new LamanUser(bunifuMaterialTextbox1.Text);
                    frm2.Show();
                }
            }

            con.Close();
        }