private void peminjamanBukuTaToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); peminjamanbuku pb = new peminjamanbuku(); if (pb.ShowDialog() == DialogResult.OK) { pb.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { string username = tbpassword.Text; string password = tbusername.Text; MySqlCommand cmd = new MySqlCommand("select * from userperpus where username='******' and password='******'", this.conn.myconnection()); MySqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { int jabatan = Convert.ToInt32(reader["jabatan"].ToString()); if (jabatan == 1) { MessageBox.Show("halo admin " + username); this.Hide(); Formbuku fb = new Formbuku(); fb.ShowDialog(); } else if (jabatan == 2) { MessageBox.Show("halo staff " + username); this.Hide(); pencarianbuku pb = new pencarianbuku(); pb.ShowDialog(); } else if (jabatan == 3) { MessageBox.Show("halo operator " + username); this.Hide(); peminjamanbuku pb = new peminjamanbuku(); pb.ShowDialog(); } //MessageBox.Show("berhasil login sebagai "+username+" dengan jabatan : "+reader["jabatan"]); } else { MessageBox.Show("gagal login"); } reader.Close(); }