Example #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            staffs a = new staffs();

            a.Show();
            this.Hide();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand    cmd = new SqlCommand("select pwd from staff where sname='" + textBox1.Text + "' ", con);
            SqlDataReader dr  = cmd.ExecuteReader();

            if (dr.Read())
            {
                password = (string)dr.GetValue(0);
                if (password == textBox2.Text)
                {
                    staffs a = new staffs();
                    a.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Password Does Not Match");
                    textBox2.Text = "";
                }
            }
            else
            {
                MessageBox.Show("Invalid Staff Name");
            }
            con.Close();
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            admin  a = new admin();
            staffs b = new staffs();

            if (i == 0)
            {
                a.Show();
                this.Hide();
            }
            else
            {
                b.Show();
                this.Hide();
            }
        }