private void ICEOLImportSchedulerMethod(object sender, EventArgs e) { ICEOLImporterTimer.Stop(); ICEOLImporterStatus.Content = "Running"; using (db = new DBConnector()) { DateTime now = TimeZoneInfo.ConvertTimeFromUtc(System.DateTime.UtcNow, TimeZoneInfo.Local); string date = now.ToString("dd-MMM-yyyy"); ICEqueues["OL Raw"].QData = OracleTableSanitizer(db.MakeQuery(ICEOLQuery.Replace("%TRADEDATE%", date), "OL Raw"));; ICEqueues["OL Raw"].ToCSV(); ICEOLImporterStatus.Content = "Last Updated at " + now.ToString("dd-mmm-yy hh:mm:ss"); } if (ICEOLImporterStatus.Content.ToString() == "Running") { ICEOLImporterStatus.Content = "Failed"; } }
private void ICEScheduleSteps() { ICESchedulerStatus.Content = "Running"; if (ICEDownloaderSwitch.Value == 1) { downLoadStarter(); ICEReconTimer.Interval = new TimeSpan(0, 1, 0); } if (olImporterSwitch.Value == 1) { ICEOLImporterTimer.Start(); ICEReconTimer.Interval = new TimeSpan(0, 1, 0); } //Running it irrespective of switch coz we need to merge the ICE Files and update the queues. Switch check is in the scheduler method ICEReconTimer.Start(); DateTime now = TimeZoneInfo.ConvertTimeFromUtc(System.DateTime.UtcNow, TimeZoneInfo.Local); ICESchedulerStatus.Content = "Last executed at " + now.ToString("dd-mmm-yy hh:mm:ss"); }