//Load danh sách các khách public DataTable loadChiTietKhachThue(DangKy dangkyphong) { String sql = "select CT_KHACH_THUE.TenKhach, KHACH_THUE.Phai, KHACH_THUE.NgheNghiep, Convert(varchar,NgayVaoPhong,103) as NgayVaoPhong from CT_KHACH_THUE, KHACH_THUE where CT_KHACH_THUE.MaKhach = KHACH_THUE.MaKhach and MaPhong = '" + dangkyphong.getMaPhong() + "'"; DataTable table = manager.executeQuery(sql); return(table); }
private void dgvPhongCoKhachThue_CellClick(object sender, DataGridViewCellEventArgs e) { string maphong = dgvTrangThaiPhong.Rows[e.RowIndex].Cells[0].Value.ToString(); DangKy dangKy = new DangKy(); dangKy.setMaPhong(maphong); dgvDanhSachKhachThuePhong.DataSource = dangKyBLL.loadChiTietKhachThue(dangKy); }
public bool ThemKhachThue(DangKy dangkyphong) { SqlParameter p1 = new SqlParameter("@makhach", dangkyphong.getMaKhach()); SqlParameter p2 = new SqlParameter("@maphong", dangkyphong.getMaPhong()); SqlParameter p3 = new SqlParameter("@ngayvaophong", dangkyphong.getNgayVaoPhong()); SqlParameter[] giatri = { p1, p2, p3 }; return(data.Update("ThemKhachThue", giatri)); }
//Thêm khách ở phòng mới public bool ThemKhachThueVaoPhongMoi(DangKy dangKyPhong) { return(DangKyDAL.getInstance().ThemKhachThueVaoPhongMoi(dangKyPhong)); }
//Thêm khách ở ghép public bool ThemKhachOghep(DangKy dangKyPhong) { return(DangKyDAL.getInstance().ThemKhachOghep(dangKyPhong)); }
public DataTable loadChiTietKhachThue(DangKy dangKyPhong) { return(DangKyDAL.getInstance().loadChiTietKhachThue(dangKyPhong)); }