Exemplo n.º 1
0
        //Lấy giá dịch vụ và hiển thị lên combobox
        public static List <DichVu_DTO> HienThiGiaDichVuLenComboBox(string maDichVu)
        {
            List <DichVu_DTO> lstGiaDichVu = new List <DichVu_DTO>();

            try
            {
                string    strTruyVan = string.Format("select * from DichVu where MaDichVu = '" + maDichVu + "'");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        DichVu_DTO dvDTO = new DichVu_DTO();
                        dvDTO.MaDichVu = _dt.Rows[i]["MaDichVu"].ToString();
                        dvDTO.DonGia   = Convert.ToInt32(_dt.Rows[i]["DonGia"]);
                        lstGiaDichVu.Add(dvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstGiaDichVu);
        }
Exemplo n.º 2
0
        //HIển thị danh sách thông tin phòng đã ở
        public static List <Phong_DTO> HienThiDSKhachHangDaCoPhong()
        {
            List <Phong_DTO> lstKhachHangDaCoPhong = null;

            try
            {
                string    strTruyVan = string.Format("select PDK.MaPhieuDK,KH.TenKH,PHG.TenPhong from PhieuDangKy as PDK,ChiTietLoaiPhong as CTLP, KhachHang as KH,Phong as PHG where PDK.MaPhieuDK = CTLP.MaPhieuDK and PDK.MaKH = KH.MaKH and CTLP.MaPhong = PHG.MaPhong and DaVaoPhong = 1");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);

                if (_dt != null)
                {
                    lstKhachHangDaCoPhong = new List <Phong_DTO>();
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        Phong_DTO phgDTO = new Phong_DTO();
                        phgDTO.MaPhieuDK = _dt.Rows[i]["MaPhieuDK"].ToString();
                        phgDTO.TenKH     = _dt.Rows[i]["TenKH"].ToString();
                        phgDTO.TenPhong  = _dt.Rows[i]["TenPhong"].ToString();;

                        lstKhachHangDaCoPhong.Add(phgDTO);
                    }
                }
                return(lstKhachHangDaCoPhong);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 3
0
        //Hiển thị tên loại phòng lên comboBox trong form Chi Tiết Loại Phòng
        public static List <LoaiPhong_DTO> HienThiTenLoaiPhong()
        {
            List <LoaiPhong_DTO> lstTenLoaiPhong = null;

            try
            {
                string    strTruyVan = string.Format("SELECT MaLoaiPhong, TenLoaiPhong FROM LoaiPhong");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);

                if (_dt != null)
                {
                    lstTenLoaiPhong = new List <LoaiPhong_DTO>();
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        LoaiPhong_DTO lphgDTO = new LoaiPhong_DTO();
                        lphgDTO.MaLoaiPhong  = _dt.Rows[i]["MaLoaiPhong"].ToString();
                        lphgDTO.TenLoaiPhong = _dt.Rows[i]["TenLoaiPhong"].ToString();


                        lstTenLoaiPhong.Add(lphgDTO);
                    }
                }
                return(lstTenLoaiPhong);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 4
0
        public static List <LoaiPhong_DTO> HienThiGiaLoaiPhongLenComboBox()
        {
            List <LoaiPhong_DTO> lstGiaLoaiPhong = new List <LoaiPhong_DTO>();

            try
            {
                string    strTruyVan = string.Format("SELECT distinct GiaLoaiPhong from LoaiPhong");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        LoaiPhong_DTO lphgDTO = new LoaiPhong_DTO();


                        lphgDTO.GiaLoaiPhong = Convert.ToInt32(_dt.Rows[i]["GiaLoaiPhong"]);

                        lstGiaLoaiPhong.Add(lphgDTO);
                    }
                }
            }

            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstGiaLoaiPhong);
        }
Exemplo n.º 5
0
        public static List <LoaiPhong_DTO> HienThiThongTinLoaiPhong(int index)
        {
            List <LoaiPhong_DTO> lstLoaiPhong = null;

            try
            {
                string    strTruyVan = string.Format("SELECT * FROM LoaiPhong");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);

                if (_dt != null)
                {
                    lstLoaiPhong = new List <LoaiPhong_DTO>();
                    for (index = 0; index < _dt.Rows.Count; index++)
                    {
                        LoaiPhong_DTO lphgDTO = new LoaiPhong_DTO();
                        lphgDTO.MaLoaiPhong  = _dt.Rows[index]["MaLoaiPhong"].ToString();
                        lphgDTO.TenLoaiPhong = _dt.Rows[index]["TenLoaiPhong"].ToString();
                        lphgDTO.TrangThietBi = _dt.Rows[index]["TrangThietBi"].ToString();
                        lphgDTO.GiaLoaiPhong = Convert.ToInt32(_dt.Rows[index]["GiaLoaiPhong"]);
                        lphgDTO.MoTa         = _dt.Rows[index]["MoTa"].ToString();

                        lstLoaiPhong.Add(lphgDTO);
                    }
                }
                return(lstLoaiPhong);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 6
0
        public static string DoiMatKhau(string maNV, string tendangnhap, string matkhau)
        {
            string id = "";

            try
            {
                string    strTruyVan = string.Format("update NhanVien set TenDangNhap = '" + tendangnhap + "', MatKhau = '" + matkhau + "' where MaNV = '" + maNV + "'");
                DataTable dt         = new DataTable();
                dt = DataProvider.fillDataTable(strTruyVan);
                if (dt != null)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        id = dt.Rows[i]["MaNV"].ToString();
                        id = dt.Rows[i]["TenDangNhap"].ToString();
                        id = dt.Rows[i]["MatKhau"].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Lỗi xảy ra khi truy vấn dữ liệu hoặc kết nối với server thất bại :" + ex.Message);
            }

            return(id);
        }
Exemplo n.º 7
0
        public static List <ChucVu_DTO> HienThiDanhSachChucVu(int index)
        {
            List <ChucVu_DTO> lstChucVu = new List <ChucVu_DTO>();

            try
            {
                string    strTruyVan = string.Format("SELECT * FROM ChucVu");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (index = 0; index < _dt.Rows.Count; index++)
                    {
                        ChucVu_DTO cvDTO = new ChucVu_DTO();
                        cvDTO.MaChucVu  = _dt.Rows[index]["MaChucVu"].ToString();
                        cvDTO.TenChucVu = _dt.Rows[index]["TenChucVu"].ToString();

                        lstChucVu.Add(cvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstChucVu);
        }
Exemplo n.º 8
0
        public static List <DichVu_DTO> HienThiTenDichVuTheoMaDichVu(string maLoaiDichVu)
        {
            List <DichVu_DTO> lstDichVu = new List <DichVu_DTO>();

            try
            {
                string    strTruyVan = string.Format("SELECT * FROM DichVu where MaLoaiDichVu = '" + maLoaiDichVu + "'");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        DichVu_DTO dvDTO = new DichVu_DTO();
                        dvDTO.MaDichVu  = _dt.Rows[i]["MaDichVu"].ToString();
                        dvDTO.TenDichVu = _dt.Rows[i]["TenDichVu"].ToString();

                        lstDichVu.Add(dvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstDichVu);
        }
Exemplo n.º 9
0
        //Lấy thông tin nhân viên lễ tân load lên comboBox
        public static List <NhanVien_DTO> HienThiDanhSachNhanVienLeTan()
        {
            List <NhanVien_DTO> lstNhanVienLeTan = new List <NhanVien_DTO>();

            try
            {
                string    strTruyVan = string.Format("select NV.MaNV,NV.TenNhanVien from NhanVien as NV, ChucVu as CV where NV.MaChucVu = CV.MaChucVu and TenChucVu like N'Nhân Viên Lễ Tân'");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        NhanVien_DTO nvDTO = new NhanVien_DTO();
                        nvDTO.MaNV        = _dt.Rows[i]["MaNV"].ToString();
                        nvDTO.TenNhanVien = _dt.Rows[i]["TenNhanVien"].ToString();

                        lstNhanVienLeTan.Add(nvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }


            return(lstNhanVienLeTan);
        }
Exemplo n.º 10
0
        public static List <DichVu_DTO> HienThiDanhSachCacDichVu(int index)
        {
            List <DichVu_DTO> lstDichVu = new List <DichVu_DTO>();

            try
            {
                string    strTruyVan = string.Format("select DV.MaDichVu,DV.TenDichVu,DV.MaLoaiDichVu,DV.DonGia,DoVi.MaDonVi,DoVi.TenDonVi from DichVu as DV, DonVi as DoVi where DV.MaDonVi = DoVI.MaDonVi");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (index = 0; index < _dt.Rows.Count; index++)
                    {
                        DichVu_DTO dvDTO = new DichVu_DTO();
                        dvDTO.MaDichVu     = _dt.Rows[index]["MaDichVu"].ToString();
                        dvDTO.TenDichVu    = _dt.Rows[index]["TenDichVu"].ToString();
                        dvDTO.DonGia       = Convert.ToInt32(_dt.Rows[index]["DonGia"]);
                        dvDTO.MaLoaiDichVu = _dt.Rows[index]["MaLoaiDichVu"].ToString();
                        dvDTO.MaDonVi      = _dt.Rows[index]["MaDonVi"].ToString();
                        dvDTO.TenDonVi     = _dt.Rows[index]["TenDonVi"].ToString();

                        lstDichVu.Add(dvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstDichVu);
        }
Exemplo n.º 11
0
        public static List <PhieuDangKy_DTO> HienThiDuLieuPDKDangCho()
        {
            List <PhieuDangKy_DTO> listPDKDTO = new List <PhieuDangKy_DTO>();

            try
            {
                string    strTruyVan = string.Format(@"SELECT DISTINCT KH.MaKH, KH.TenKH, PDK.MaPhieuDK, PDK.TienDatCoc, PDK.MaNV, PDK.MaKH, KH.NgaySinh, KH.GioiTinh, KH.CMND, KH.QuocTich, KH.DiaChi, KH.SDT FROM PhieuDangKy as PDK, KhachHang as KH WHERE PDK.MaKH = KH.MaKH AND KH.DaXacNhan = 1 AND ISNULL(PDK.DaVaoPhong,'false') not in (1)");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int index = 0; index < _dt.Rows.Count; index++)
                    {
                        PhieuDangKy_DTO pdkDTO = new PhieuDangKy_DTO();
                        pdkDTO.TenKH      = _dt.Rows[index]["TenKH"].ToString();
                        pdkDTO.MaPhieuDK  = _dt.Rows[index]["MaPhieuDK"].ToString();
                        pdkDTO.TienDatCoc = double.Parse(_dt.Rows[index]["TienDatCoc"].ToString());
                        pdkDTO.MaNV       = _dt.Rows[index]["MaNV"].ToString();
                        pdkDTO.MaKH       = _dt.Rows[index]["MaKH"].ToString();
                        listPDKDTO.Add(pdkDTO);
                    }
                }
                return(listPDKDTO);
            }


            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 12
0
        //Hiển thị mã phiếu đăng ký mà chưa có xác nhận đặt phòng ở
        public static List <PhieuDangKy_DTO> HienThiMaPhieuDangKyChuaDuocDatPhong()
        {
            List <PhieuDangKy_DTO> lstMaPhieuDKChuaDuocDP = new List <PhieuDangKy_DTO>();

            try
            {
                string    strTruyVan = string.Format("select * from PhieuDangKy where DaXacNhan = 0");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    if (lstMaPhieuDKChuaDuocDP == null)
                    {
                        lstMaPhieuDKChuaDuocDP = new List <PhieuDangKy_DTO>();
                    }
                    PhieuDangKy_DTO pdkDTO = null;
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        pdkDTO           = new PhieuDangKy_DTO();
                        pdkDTO.MaPhieuDK = _dt.Rows[i]["MaPhieuDK"].ToString();

                        lstMaPhieuDKChuaDuocDP.Add(pdkDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
            return(lstMaPhieuDKChuaDuocDP);
        }
Exemplo n.º 13
0
        public static List <LoaiDichVu_DTO> HienThiTenLoaiDichVuLenComboBox()
        {
            List <LoaiDichVu_DTO> lstTenLoaiDichVu = new List <LoaiDichVu_DTO>();

            try
            {
                string    strTruyVan = string.Format("SELECT * FROM LoaiDichVu");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        LoaiDichVu_DTO ldvDTO = new LoaiDichVu_DTO();
                        ldvDTO.MaLoaiDichVu  = _dt.Rows[i]["MaLoaiDichVu"].ToString();
                        ldvDTO.TenLoaiDichVu = _dt.Rows[i]["TenLoaiDichVu"].ToString();

                        lstTenLoaiDichVu.Add(ldvDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }

            return(lstTenLoaiDichVu);
        }
Exemplo n.º 14
0
        public static List <Phong_DTO> HienThiDanhSachCacPhong()
        {
            List <Phong_DTO> lstTenPhong = null;

            try
            {
                string    strTruyVan = string.Format("select MaPhong,TenPhong, (CASE WHEN TinhTrangPhong='1' THEN N'Phòng có khách' ELSE N'Phòng trống' END) AS TinhTrangPhong,MaLoaiPhong from Phong");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);

                if (_dt != null)
                {
                    lstTenPhong = new List <Phong_DTO>();
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        Phong_DTO phgDTO = new Phong_DTO();
                        phgDTO.TenPhong       = _dt.Rows[i]["TenPhong"].ToString();
                        phgDTO.MaPhong        = _dt.Rows[i]["MaPhong"].ToString();
                        phgDTO.TinhTrangPhong = _dt.Rows[i]["TinhTrangPhong"].ToString();
                        phgDTO.MaLoaiPhong    = _dt.Rows[i]["MaLoaiPhong"].ToString();
                        lstTenPhong.Add(phgDTO);
                    }
                }
                return(lstTenPhong);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 15
0
        //Hiển thị tên phòng đã có khách đặt
        public static List <Phong_DTO> HienThiTenPhongTheoMaLoaiPhong_CoNguoi(string maLoaiPhong)
        {
            List <Phong_DTO> lstTenPhong = null;

            try
            {
                string    strTruyVan = string.Format("select MaPhong,TenPhong from Phong where MaLoaiPhong = '" + maLoaiPhong + "' and ISNULL(TinhTrangPhong,'false') not in(0) ");
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);

                if (_dt != null)
                {
                    lstTenPhong = new List <Phong_DTO>();
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        Phong_DTO phgDTO = new Phong_DTO();
                        phgDTO.TenPhong = _dt.Rows[i]["TenPhong"].ToString();
                        phgDTO.MaPhong  = _dt.Rows[i]["MaPhong"].ToString();
                        // phgDTO.MaLoaiPhong = _dt.Rows[i]["MaLoaiPhong"].ToString();
                        lstTenPhong.Add(phgDTO);
                    }
                }
                return(lstTenPhong);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 16
0
        public static string LayMaQuyenHan(string maCanLay)
        {
            string id = "";

            try
            {
                string    strTruyVan = string.Format("select * from NhanVien where MaNV = '" + maCanLay + "'");
                DataTable dt         = new DataTable();
                dt = DataProvider.fillDataTable(strTruyVan);
                if (dt != null)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        //Nếu tài khoản còn được sử dụng thì mới có mã quyền hạn
                        if (dt.Rows[i]["DinhChi"].ToString() == "False")
                        {
                            id = dt.Rows[i]["MaQuyenHan"].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Lỗi xảy ra khi truy vấn dữ liệu hoặc kết nối với server thất bại :" + ex.Message);
            }

            return(id);
        }
Exemplo n.º 17
0
        public static List <PhieuDangKy_DTO> HienThiDanhSachKhachHangTrongPDK(int index)
        {
            List <PhieuDangKy_DTO> lstPhieuDangKy = null;

            try
            {
                string    strTruyVan = @"SELECT DISTINCT KH.MaKH ,KH.TenKH,PDK.MaPhieuDK,PDK.NgayDen,PDK.GioDen,PDK.NgayDi,PDK.GioDi,PDK.SoLuongNguoiLon,PDK.SoLuongTreEm,PDK.TienDatCoc,PDK.MaNV,PDK.MaKH,KH.NgaySinh,KH.GioiTinh,KH.CMND,KH.QuocTich,KH.DiaChi,KH.SDT
              FROM PhieuDangKy as PDK, KhachHang as KH
            WHERE PDK.MaKH = KH.MaKH AND KH.DaXacNhan = 1";
                DataTable _dt        = new DataTable();
                _dt = DataProvider.fillDataTable(strTruyVan);
                if (_dt != null)
                {
                    if (lstPhieuDangKy == null)
                    {
                        lstPhieuDangKy = new List <PhieuDangKy_DTO>();
                    }
                    PhieuDangKy_DTO pdkDTO = null;
                    for (index = 0; index < _dt.Rows.Count; index++)
                    {
                        pdkDTO           = new PhieuDangKy_DTO();
                        pdkDTO.TenKH     = _dt.Rows[index]["TenKH"].ToString();
                        pdkDTO.MaPhieuDK = _dt.Rows[index]["MaPhieuDK"].ToString();
                        pdkDTO.NgayDen   = Convert.ToDateTime(_dt.Rows[index]["NgayDen"].ToString());
                        DateTime dtGioDen  = Convert.ToDateTime(_dt.Rows[index]["GioDen"].ToString());
                        string   strGioDen = String.Format("{0:00}:{1:00}:{2:00}", dtGioDen.Hour, dtGioDen.Minute, dtGioDen.Second);
                        DateTime dtGioDi   = Convert.ToDateTime(_dt.Rows[index]["GioDi"].ToString());
                        string   strGioDi  = String.Format("{0:00}:{1:00}:{2:00}", dtGioDi.Hour, dtGioDi.Minute, dtGioDi.Second);

                        pdkDTO.GioDen = strGioDen;
                        pdkDTO.GioDi  = strGioDi;

                        pdkDTO.NgayDi          = Convert.ToDateTime(_dt.Rows[index]["NgayDi"].ToString());
                        pdkDTO.SoLuongNguoiLon = int.Parse(_dt.Rows[index]["SoLuongNguoiLon"].ToString());
                        pdkDTO.SoLuongTreEm    = int.Parse(_dt.Rows[index]["SoLuongTreEm"].ToString());
                        pdkDTO.TienDatCoc      = double.Parse(_dt.Rows[index]["TienDatCoc"].ToString());
                        pdkDTO.MaNV            = _dt.Rows[index]["MaNV"].ToString();
                        pdkDTO.MaKH            = _dt.Rows[index]["MaKH"].ToString();

                        lstPhieuDangKy.Add(pdkDTO);
                    }
                }
                return(lstPhieuDangKy);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
                return(null);
            }
        }
Exemplo n.º 18
0
        public static DataTable LayThuocTinhPhong()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select MaPhong,TenPhong from Phong where TinhTrangPhong = 1");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 19
0
        public static DataTable TimTenPhong(string tenPhong)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select PDK.MaPhieuDK,KH.MaKH,KH.TenKH,KH.GioiTinh,KH.NgaySinh,KH.DiaChi,KH.CMND,SDT,KH.QuocTich,PHG.MaPhong,PHG.TenPhong from PhieuDangKy as PDK,ChiTietLoaiPhong as CTLP, KhachHang as KH,Phong as PHG where PDK.MaPhieuDK = CTLP.MaPhieuDK and PDK.MaKH = KH.MaKH and CTLP.MaPhong = PHG.MaPhong and DaVaoPhong = 1 and PHG.TinhTrangPhong = 1 and PHG.TenPhong like '%" + tenPhong + "%'");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 20
0
        public static DataTable LayMaPhieuDK()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT MaPhieuDK from PhieuDangKy");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 21
0
        public static DataTable TimMaPhieuDK(string maPhieuDK)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT * FROM PhieuDangKy WHERE MaPhieuDK = '" + maPhieuDK + "'");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }
            return(dt);
        }
Exemplo n.º 22
0
        public static DataTable LayMaChiTietHoaDon()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT * FROM ChiTietHoaDon");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 23
0
        public static DataTable HienThiMaPhong(string maPhong)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select * from Phong where TinhTrangPhong = 1 and MaPhong = '" + maPhong + "'");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 24
0
        public static DataTable TimMaHoaDon(string maHoaDon)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT * FROM HoaDon WHERE MaHoaDon = '" + maHoaDon + "'");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 25
0
        public static DataTable HienThiDanhSachHoaDon()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select HD.MaHoaDon,HD.NgayThanhToan,CTHD.TienDichVu,CTHD.TienPhong,CTHD.PhuThu,HD.SoTienDaDatTruoc,HD.TongTienHoaDon from HoaDon as HD inner join ChiTietHoaDon as CTHD on HD.MaChiTietHoaDon = CTHD.MaChiTietHoaDon where CTHD.DaThanhToan = 1");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 26
0
        public static DataTable HienThiDanhSachChiTietHoaDon()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT * FROM ChiTietHoaDon where DaThanhToan = 0");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 27
0
        public static DataTable HienThiDanhSachCacDichVuCanCapNhat(string maDichVu, string maPhong)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select distinct d.MaSuDungDichVu, p.MaPhong, p.TenPhong, k.TenKH,ldv.MaLoaiDichVu,ldv.TenLoaiDichVu,TenDichVu,count(TenDichVu) as [SoLuong],sum(ThanhTien)as [Tong Tien] from DanhSachSDDichVu d join Phong p on p.MaPhong = d.MaPhong join ChiTietLoaiPhong c on p.MaPhong = c.MaPhong join PhieuDangKy ph on ph.MaPhieuDK = c.MaPhieuDK join KhachHang k on k.MaKH = ph.MaKH join DichVu dv on dv.MaDichVu = d.MaDichVu join LoaiDichVu ldv on dv.MaLoaiDichVu = ldv.MaLoaiDichVu where p.MaPhong = '" + maPhong + "' and d.MaDichVu = '" + maDichVu + "' group by TenDichVu, k.TenKH, p.TenPhong, p.MaPhong, d.MaSuDungDichVu,ldv.MaLoaiDichVu,ldv.TenLoaiDichVu");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error : " + ex.Message);
            }
            return(dt);
        }
Exemplo n.º 28
0
        public static DataTable LayMaKhachHang()
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT MaKH,TenKH from KhachHang");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 29
0
        public static DataTable TimTenKhachHang(string tenKH)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("SELECT * FROM KhachHang WHERE TenKH = N'" + tenKH + "'");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }
Exemplo n.º 30
0
        public static DataTable HienThiDanhSachMaSuDungDichVu(string maPhong)
        {
            DataTable dt = new DataTable();

            try
            {
                string strTruyVan = string.Format("select * from DanhSachSDDichVu as DS inner join Phong as PHG on DS.MaPhong = PHG.MaPhong where PHG.MaPhong = '" + maPhong + "' and TinhTrangPhong = 1");
                dt = DataProvider.fillDataTable(strTruyVan);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dt);
        }