public override void Run(DateTime now) { nextRunTime = new DateTime(1900, 1, 1); MessageBll bll = new MessageBll(); SumStudentBll dailyBll = new SumStudentBll(); int count = 1; while (count <= 10) { try { string message = bll.ReceiveMessage(MessageChannel.REPORT_CHANNEL); if (!string.IsNullOrEmpty(message)) { dailyBll.SaveReportData(message); Thread.Sleep(20); } else { nextRunTime = DateTime.Now.AddSeconds(3); break; } } catch (Exception ex) { LogHelper.ErrorLog(this.JobName(), ex); } count++; } }
public void ReceiveMessageTest() { MessageBll bll = new MessageBll(); string msg = bll.ReceiveMessage(MessageChannel.REPORT_CHANNEL); SumStudentBll dailyBll = new SumStudentBll(); dailyBll.SaveReportData(msg); }