示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();

            OleDbCommand cmd = new OleDbCommand();

            cmd.Connection  = con;
            cmd.CommandText = " select * from Table1 where Email =  '" + email.Text + "' and Password =  '******' and Type =  'admin'";
            OleDbDataReader reader = cmd.ExecuteReader();

            //cmd.ExecuteNonQuery();
            count = 0;
            while (reader.Read())
            {
                count++;
            }

            if (count == 1)
            {
                MessageBox.Show("Access permitted.");
                con.Close();
                this.Hide();
                Admin_show admin = new Admin_show();
                admin.Show();
            }
            else
            {
                MessageBox.Show("Access denide");
                con.Close();
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            Admin_show a_s = new Admin_show();

            a_s.Show();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            Admin_show admin = new Admin_show();

            admin.Show();
        }