Пример #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 DataSet nangcao(string strsach, string tacgia, string strphanloai, string strngonngu)
        {
            string strkn = "select sach.masach as ' Mã Sách',sach.nhande as 'Nhan Đề',tacgia.tentacgia as 'Tên tác giả',ngonngu.ngonngu as 'Ngôn ngữ',sach.soluong as 'Sách còn',vitriluutru.kho, vitriluutru.ke as 'Kệ',vitriluutru.ngan as 'Ngăn' from tacgia,phanloai,ngonngu,sach,vitriluutru where sach.mavitri = vitriluutru.mavitri and sach.maphanloai = phanloai.maphanloai and tacgia.matacgia = sach.matacgia and sach.mangonngu = ngonngu.mangonngu and sach.nhande like N'%" + strsach + "%' ";

            if (tacgia != "")
            {
                strkn = strkn + " and tacgia.tentacgia like N'%" + tacgia + "%'";
            }
            if (strphanloai != "")
            {
                strkn = strkn + " and phanloai.loai like N'%" + strphanloai + "%'";
            }
            if (strngonngu != "")
            {
                strkn = strkn + " and ngonngu.ngonngu like N'%" + strngonngu + "%'";
            }
            laydulieu dl = new laydulieu();

            return(dl.getdata(strkn));
        }
Пример #3
0
        public DataSet coban(string strtk)
        {
            laydulieu dl = new laydulieu();

            return(dl.getdata("select sach.masach as ' Mã Sách',sach.nhande as 'Nhan Đề',tacgia.tentacgia as 'Tên tác giả',ngonngu.ngonngu as 'Ngôn ngữ',sach.soluong as 'Sách còn',vitriluutru.kho, vitriluutru.ke as 'Kệ',vitriluutru.ngan as 'Ngăn' from tacgia,phanloai,ngonngu,sach,vitriluutru where sach.mavitri = vitriluutru.mavitri and sach.maphanloai = phanloai.maphanloai and tacgia.matacgia = sach.matacgia and sach.mangonngu = ngonngu.mangonngu and (sach.nhande like N'%" + strtk + "%' or tacgia.tentacgia like N'%" + strtk + "%' or sach.masach='" + strtk + "')"));
        }