Exemplo n.º 1
0
        private void btndangnhap_Click(object sender, EventArgs e)
        {
            var user = data.TaiKhoans.Where(tk => tk.TenDN == txtuser.Text && tk.MatKhau == txtpassword.Text).First();

            if (user != null)
            {
                var user_pq = data.Taikhoan_PhanQuyens.Where(x => x.id_ND == user.id).First();

                if (user_pq.Gioihan != false)
                {
                    MessageBox.Show("Bạn đã bị chặn !!! Hãy liên hệ admin để giải quyết");
                }
                else
                {
                    BienToanCuc.bientoancuc.ID_PQ = user_pq.id_PQ;

                    Form_danh_muc frm = new Form_danh_muc();
                    frm.ShowDialog();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("lan lan xinh dang nhap lai");
            }
        }
Exemplo n.º 2
0
 private void btndangnhap_Click(object sender, EventArgs e)
 {
     if (txtuser.Text == "")
     {
         MessageBox.Show("Bạn chưa nhập username!", "erro");
     }
     else if (txtpassword.Text == "")
     {
         MessageBox.Show("Bạn chưa nhập password !", "erro");
     }
     else
     {
         if (txtuser.Text == "admin" && txtpassword.Text == "admin")
         {
             Form_danh_muc frm = new Form_danh_muc();
             frm.ShowDialog();
             //frm.Hide();
         }
         else
         {
             MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng vui lòng nhập lại !", "Erro");
             txtpassword.Clear();
             txtuser.Focus();
         }
     }
 }