示例#1
0
        //Hàm load dữ liệu lên DataTable
        public DataTable LoadDL_Table(string str_load)
        {
            DataTable tb = new DataTable();

            tb = ketnoi.GetTable(str_load);
            return(tb);
        }
 public DataTable LoadDL(string strsearch = null)
 {
     if (strsearch == null)
     {
         return(ketnoi.GetTable("select TENKH, CMDN, SDT, DIACHI, GIOITINH, TENP,NGAYNHAN from KHACHHANG, PHIEUTHUEPHONG, CHITIETPHIEUTHUEPHONG, PHONG  where PHIEUTHUEPHONG.MAPT = CHITIETPHIEUTHUEPHONG.MAPT and KHACHHANG.MAKH = PHIEUTHUEPHONG.MAKH and PHONG.MAP = CHITIETPHIEUTHUEPHONG.MAP"));
     }
     else
     {
         return(ketnoi.GetTable("select TENKH, CMDN, SDT, DIACHI, GIOITINH, TENP,NGAYNHAN from KHACHHANG, PHIEUTHUEPHONG, CHITIETPHIEUTHUEPHONG, PHONG where PHIEUTHUEPHONG.MAPT = CHITIETPHIEUTHUEPHONG.MAPT and KHACHHANG.MAKH = PHIEUTHUEPHONG.MAKH and PHONG.MAP = CHITIETPHIEUTHUEPHONG.MAP and CMDN like '%" + strsearch + "%'"));
     }
 }
示例#3
0
        public void Load_Du_Lieu_Len_Gridview()
        {
            //Load dữ liệu lên Datagridview
            ThuVienKetNoi ketnoi = new ThuVienKetNoi();

            dtgridview_phong.DataSource = ketnoi.GetTable("SELECT * FROM PHONG");
        }
        //Hàm kiểm tra người dùng có phải là admin hay không
        public bool is_admin(string user)
        {
            string        str           = "select * from NGUOIDUNG where TENDANGNHAP = N'" + user + "'";
            ThuVienKetNoi ketnoi        = new ThuVienKetNoi();
            DataTable     loainguoidung = ketnoi.GetTable(str);
            string        lnd           = loainguoidung.Rows[0][2].ToString();

            if (lnd == "ADMIN")
            {
                return(true);
            }
            return(false);
        }
示例#5
0
        private void dtgridview_phong_SelectionChanged(object sender, EventArgs e)
        {
            txt_maphong.Text   = dtgridview_phong.CurrentRow.Cells[0].Value.ToString();
            txt_tenphong.Text  = dtgridview_phong.CurrentRow.Cells[1].Value.ToString();
            txt_giaphong.Text  = dtgridview_phong.CurrentRow.Cells[2].Value.ToString();
            txt_tinhtrang.Text = dtgridview_phong.CurrentRow.Cells[3].Value.ToString();

            ThuVienKetNoi ketnoi = new ThuVienKetNoi();

            cbo_maloaiphong.DataSource    = ketnoi.GetTable("select MALOAIP from LOAIPHONG");
            cbo_maloaiphong.DisplayMember = "MALOAIP";
            cbo_maloaiphong.ValueMember   = "MALOAIP";
            cbo_maloaiphong.SelectedValue = dtgridview_phong.CurrentRow.Cells[4].Value.ToString();

            txt_ghichu.Text = dtgridview_phong.CurrentRow.Cells[5].Value.ToString();
        }
        //Kiểm tra đăng nhập: 0 - Không tồn tại; 1 - Mật khẩu sai; 2 - Đăng nhập thành công, phân quyền
        public int KiemTraDangNhap(string tendangnhap, string matkhau)
        {
            string        str    = "select * from NGUOIDUNG where TENDANGNHAP = N'" + tendangnhap + "'";
            ThuVienKetNoi ketnoi = new ThuVienKetNoi();
            DataTable     user   = ketnoi.GetTable(str);

            if (user.Rows.Count == 0)
            {
                return(0);
            }
            string mk = user.Rows[0][1].ToString().Trim();

            if (mk != matkhau)
            {
                return(1);
            }
            return(2);
        }
示例#7
0
 //Hàm load dữ liệu
 public DataTable LoadDL(string hoadon = null)
 {
     return(ketnoi.GetTable("select HOADON.MAHD, TENNV, TENKH, MAP, NGAYLAP, TONGTIEN from HOADON, NHANVIEN, KHACHHANG, CHITIETHOADON where NHANVIEN.MANV = HOADON.MANV and KHACHHANG.MAKH = HOADON.MAKH and HOADON.MAHD = CHITIETHOADON.MAHD "));
 }
 //Hàm trả về bảng để load lên Datagridview
 public DataTable LoadTable(string loai)
 {
     return(ketnoi.GetTable("select * from LOAIPHONG"));
 }
示例#9
0
 public DataTable LoadTable(string loai)
 {
     return(ketnoi.GetTable("select * from BenhVatNuoi"));
 }
示例#10
0
        public void Load_Du_Lieu()
        {
            ThuVienKetNoi ketnoi = new ThuVienKetNoi();

            dtgridview_nhanvien.DataSource = ketnoi.GetTable("SELECT * FROM NHANVIEN");
        }
示例#11
0
 public object Load_Du_Lieu_Len_Girdview()
 {
     return(ketnoi.GetTable("select TENDANGNHAP, MATKHAU, LOAINGUOIDUNG from NGUOIDUNG"));
 }
示例#12
0
 public DataTable LoadTable(string khuvuc)
 {
     return(ketnoi.GetTable("select * from KhuVuc"));
 }
示例#13
0
 public DataTable LoadTable(string khuvuc)
 {
     return(ketnoi.GetTable("select * from GiongVatNuoi"));
 }
示例#14
0
 public DataTable LoadTable(string loai)
 {
     return(ketnoi.GetTable("select * from LoaiVacxin"));
 }
 public DataTable LoadMAKH_Dang_Thue()
 {
     return(ketnoi.GetTable("select DISTINCT(MAKH) from PHIEUTHUEPHONG"));
 }
示例#16
0
 public DataTable LoadTable(string loai)
 {
     return(ketnoi.GetTable("select * from NhaCungCap"));
 }
示例#17
0
 public object Load_GiongVN_Cbo()
 {
     return(ketnoi.GetTable("select TenGiong from GiongVatNuoi"));
 }