Ejemplo n.º 1
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            QuanLyKaraokeDB db  = new QuanLyKaraokeDB();
            var             row = db.GetData($"select * from NHANVIEN where tenDN='{usernameTxt.Text.ToString()}' and matKhau='{passTxt.Text.ToString()}'").Rows;

            if (row.Count == 1)
            {
                string username  = row[0].ItemArray[0].ToString();
                bool   isManager = Convert.ToInt32(row[0].ItemArray[8].ToString()) == 1;
                Console.WriteLine(row[0].ItemArray[7]);
                Console.WriteLine(isManager);
                this.Hide();
                TrangChu f = new TrangChu(isManager, username);
                f.Text = "Trang Chủ";
                f.ShowDialog();
            }
            else
            {
                alertLabel.Visible = true;
            }
        }