public void ThemHopDong(DTOHopDong dtoHD) { using (PhongTroDBDataContext pt = new PhongTroDBDataContext()) { pt.HopDong_Them(dtoHD.ngaythue, dtoHD.ngaytra, dtoHD.ngaylamhopdong, dtoHD.tiencoc, dtoHD.giathue, dtoHD.chisodien, dtoHD.chisonuoc, dtoHD.ghichu); pt.SubmitChanges(); } BAL_ThuePhong balTP = new BAL_ThuePhong(); BAL_Khach balK = new BAL_Khach(); foreach (Int64 makhach in balTP.DanhSachMaKhachTheoMaHopDong(dtoHD.mahopdong)) { balK.CapNhatStatusTungKhach(makhach); } }