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)); }
//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); }