public void load_list_dichvu() { PhongBUS pbus = new PhongBUS(); ChiTietThuePhongBUS cttpbus = new ChiTietThuePhongBUS(); dgvCTDV.DataSource = DataTable_DSDV(ctdvbus.getctdv(MaThue, cttpbus.getMaKhach_By_MaPhong_TrangThai(pbus.maPhong_byTen(TenPhong), false))); }
/**Tạo sự kiện kích chuột phải vào label để lấy các thông tin trong label đó * ra truyền qua các form khác* */ public void lblred_Click(object sender, MouseEventArgs e) { PhongBUS pbus = new PhongBUS(); ChiTietThuePhongBUS cttpbus = new ChiTietThuePhongBUS(); ThuePhongBUS tpbus = new ThuePhongBUS(); Label lbl = sender as Label; if (e.Button == MouseButtons.Right) { string ttPhong = lbl.Text; string[] lsPhong = ttPhong.Split('\r'); string tenPhong = lsPhong[0].Trim(); frmTraKhachLe.TenPhong = tenPhong; frmDatPhong.TenLoaiPhong = "Phòng " + lpbus.getTen_Byma(pbus.getLoaiPhong_ByID(pbus.maPhong_byTen(tenPhong))); frmTraKhachLe.LoaiPhong = "Phòng " + lpbus.getTen_Byma(pbus.getLoaiPhong_ByID(pbus.maPhong_byTen(tenPhong))); frmDatPhong.TenPhong = tenPhong; frmTraKhachLe.MaThue = cttpbus.getMaThue_By_MaPhong_TrangThai(pbus.maPhong_byTen(tenPhong), false); frmDatPhong.maThue = cttpbus.getMaThue_By_MaPhong_TrangThai(pbus.maPhong_byTen(tenPhong), false); frmDatPhong.maKhachHang = cttpbus.getMaKhach_By_MaPhong_TrangThai(pbus.maPhong_byTen(tenPhong), false); frmDoiPhong.TenPhong = tenPhong; frmDoiPhong.maThue = cttpbus.getMaThue_By_MaPhong_TrangThai(pbus.maPhong_byTen(tenPhong), false); TenPhong = tenPhong; } }