public static bool XoaPT(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "update PhieuThuePhong set "
     + "TrangThai = '" + ptDTO.TrangThai
     + "' where MaPhieuThue = " + ptDTO.MaPT;
     return DataProvider.ExecuteNonQuery(strsql, con);
 }
 public static bool ThemPT(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "insert into PhieuThuePhong"
     + "(MaPhieuThue, MaPhong, NgayThuePhong, NgayTraPhong) values ("
     + ptDTO.MaPT + "," + ptDTO.Phong + ",'" + ptDTO.NgayThue + "','"
     + ptDTO.NgayTra + "')";
     return DataProvider.ExecuteNonQuery(strsql, con);
 }
 public static bool ThemKH(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "insert into KhachHang"
     + "(MaKH, TenKH, GiayToTuyThan, GioiTinh, DiaChi, SoDT, MaLK, MaPhieuThue)"
     + " values (" + ptDTO.MaKH + ",'" + ptDTO.KhachHang + "',"
     + ptDTO.CMND + ",'" + ptDTO.GioiTinh + "','" + ptDTO.DiaChi + "',"
     + ptDTO.DienThoai + "," + ptDTO.LoaiKhach + "," + ptDTO.MaPT + ")";
     return DataProvider.ExecuteNonQuery(strsql, con);
 }
 public static bool XoaPT(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.XoaPT(ptDTO);
 }
 public static bool ThemPT(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.ThemPT(ptDTO);
 }
 public static DataSet LayThongTinPhieuThue(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.LayThongTinPhieuThue(ptDTO);
 }
 public static string LayMaTuPhieuDong(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.LayMaTuPhieuDong(ptDTO);
 }
 public static DataSet LayDanhSachPhong(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.LayDanhSachPhong(ptDTO);
 }
 public static DataSet LayDanhLoaiKhach(PhieuThueDTO ptDTO)
 {
     return PhieuThueDAO.LayDanhLoaiKhach(ptDTO);
 }
 public static DataSet LayThongTinPhieuThue(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "Select * from PhieuThuePhong where MaPhieuThue = " + ptDTO.MaPT;
     return DataProvider.GetDataSet(strsql, con);
 }
 public static string LayMaTuPhieuDong(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "select max(MaPhieuThue) from PhieuThuePhong";
     return DataProvider.ExecuteScalar(strsql, con);
 }
 public static DataSet LayDanhSachPhong(PhieuThueDTO ptDTO)
 {
     SqlConnection con = DataProvider.ConnectionString();
     string strsql = "Select * from Phong";
     return DataProvider.GetDataSet(strsql, con);
 }