private void detach_ImportCompletedEmailNoticeStatus(ImportCompletedEmailNoticeStatus entity)
		{
			this.SendPropertyChanging();
			entity.Hotel = null;
		}
 partial void InsertImportCompletedEmailNoticeStatus(ImportCompletedEmailNoticeStatus instance);
 partial void DeleteImportCompletedEmailNoticeStatus(ImportCompletedEmailNoticeStatus instance);
 private void UpdateEmailNoticeStatus(int yearCode, int? monthCode, int hotelId)
 {
   using (var context = Helper.GetDataContext())
   {
     var r = context.ExecuteQuery<ImportReport>(@"
       select top 1 r.* from ImportReport r left join(
       select * from dbo.DataImportBudgetTracking 
       where issuccess = 'true' and YearCode={0} and HotelId={1}
       ) dt
       on r.ImportReportName=dt.InputTableName where dt.Id is null and r.Kind='预算类'", yearCode, hotelId);
     if (r.Count() == 0) //已经导入完全部报表
     {
       var en = context.ImportCompletedEmailNoticeStatus.FirstOrDefault(i => i.HotelId == hotelId && i.YearCode == yearCode && i.MonthCode == monthCode);
       if (en == null)
       {
         en = new ImportCompletedEmailNoticeStatus()
         {
           YearCode = yearCode,
           MonthCode = monthCode,
           MonthDate = new DateTime(yearCode, 1, 1),
           HotelId = hotelId,
           EmailSendStatus = 0,
           Kind = "实际类"
         };
         context.ImportCompletedEmailNoticeStatus.InsertOnSubmit(en);
         context.SubmitChanges();
       }
     }
   }
 }