Example #1
0
        private void button_WOC1_Click(object sender, EventArgs e)
        {
            ketNoi.DbConnection();
            string sql = "select count(*) from nhanvien where tk='" + txttendn.Text + "' and pass='******'";

            if (ketNoi.getCount(sql) == 0)
            {
                MessageBox.Show("Tài khoản hoặc mật khẩu sai. Vui lòng nhập lại.");
            }
            else
            {
                if (txttendn.Text == "admin")
                {
                    this.Hide();
                    admin.ten = "admin";
                    QuanLiSan f2 = new QuanLiSan();
                    f2.ShowDialog();
                    this.Close();
                }
                else
                {
                    this.Hide();
                    admin.ten = "nhanvien";
                    QuanLiSan f2 = new QuanLiSan();
                    f2.ShowDialog();
                    this.Close();
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            QuanLiSan ql = new QuanLiSan();

            ql.ShowDialog();
            this.Close();
        }