Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form12AdminTask obj = new Form12AdminTask();

            obj.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void Back_Click(object sender, EventArgs e)
        {
            Form12AdminTask ob = new Form12AdminTask();

            ob.Show();
            this.Hide();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            msg.Text = "";



            connection.Open();

            OleDbCommand command = new OleDbCommand();

            command.Connection  = connection;
            command.CommandText = "select * from AdminLogIn where Admin_id='" + textBox1.Text + "'and password='******'";

            OleDbDataReader reader = command.ExecuteReader();

            int count = 0;

            while (reader.Read())
            {
                count = count + 1;
            }

            connection.Close();
            textBox1.Clear();
            textBox2.Clear();
            if (count == 1)
            {
                // MessageBox.Show("user name and password is currect");

                Form12AdminTask obj = new Form12AdminTask();
                obj.Show();
                this.Hide();
            }
            else if (count > 1)
            {
                msg.Text = "Duplicate Admin Name and password";
                // MessageBox.Show("Duplicate user name and password");
            }
            else
            {
                msg.Text = "Admin Name and Password is NO CURRECT";
                // MessageBox.Show("user name and password is NO CURRECT");
            }
        }