Пример #1
0
        public bool kt_dangnhap(string ten, string matkhau, string tenserver, string matkhauserver)
        {
            Lnhanvien nv = new Lnhanvien();

            try
            {
                if (tenserver != "")
                {
                    L_Ketnoi.strChuoiKN = L_Ketnoi.strChuoiKN + "; server= " + tenserver;
                    if (matkhauserver != "")
                    {
                        L_Ketnoi.strChuoiKN = L_Ketnoi.strChuoiKN + " ; Password = "******"select * from nhanvien where matkhau = '" + matkhau + "' and tendangnhap = '" + ten + "'");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    L_Ketnoi.HuyKetNoi(); return(false);
                }
                else
                {
                    strmanhanvien = ds.Tables[0].Rows[0]["manhanvien"].ToString();
                    strhoten      = ds.Tables[0].Rows[0]["hoten"].ToString();
                    strdiachi     = ds.Tables[0].Rows[0]["diachi"].ToString();
                    strquyenhan   = ds.Tables[0].Rows[0]["quyenhan"].ToString();
                    strnguoidung  = ds.Tables[0].Rows[0]["tendangnhap"].ToString();
                    strmatkhau    = ds.Tables[0].Rows[0]["matkhau"].ToString();
                    L_Ketnoi.HuyKetNoi();
                    return(true);
                }
            }
            catch { return(false); }
        }
Пример #2
0
 public laydulieu()
 {
     L_Ketnoi.ThietlapketNoi();
 }