private void monthlyReportInvoker(BCCReportScheduleStruct mlyRepSchd) { // Set the year, month and day to today mlyRepSchd.Year = dtCurrent.Year.ToString(); Int32 runInterval = 0; // Create actual report schedule date. DateTime dtScheduled = new DateTime(Int32.Parse(mlyRepSchd.Year), Int32.Parse(mlyRepSchd.Month), Int32.Parse(mlyRepSchd.Day), Int32.Parse(mlyRepSchd.HH), Int32.Parse(mlyRepSchd.MI), 0); if (dtScheduled.Month.Equals(dtCurrent.Month) && dtScheduled.Day.Equals(dtCurrent.Day) && dtScheduled.CompareTo(dtCurrent) > 0) { System.TimeSpan timeDiff = dtScheduled.Subtract(dtCurrent); if ((timeDiff.TotalMilliseconds < INTERVAL) || (timeDiff.TotalMilliseconds == 0)) { runInterval = Convert.ToInt32(timeDiff.TotalMilliseconds); mlyTime = new System.Threading.Timer(dispatchMlyReport, mlyRepSchd, runInterval, System.Threading.Timeout.Infinite); } } }
private void weeklyReportInvoker(BCCReportScheduleStruct wklyRepSchd) { // // Set the year, month and day to today // wklyRepSchd.Year = dtCurrent.Year.ToString(); // wklyRepSchd.Month = dtCurrent.Month.ToString(); // Int32 runInterval = 0; // // Create actual report schedule date. // DateTime dtScheduled = new DateTime(Int32.Parse(wklyRepSchd.Year), Int32.Parse(wklyRepSchd.Month), Int32.Parse(wklyRepSchd.Day), Int32.Parse(wklyRepSchd.HH), Int32.Parse(wklyRepSchd.MI), 0); // if (dtScheduled.DayOfWeek.Equals(dtCurrent.DayOfWeek) && dtScheduled.CompareTo(dtCurrent) > 0) // { // System.TimeSpan timeDiff = dtScheduled.Subtract(dtCurrent); // if ((timeDiff.TotalMilliseconds < INTERVAL) || (timeDiff.TotalMilliseconds == 0)) // { // runInterval = Convert.ToInt32(timeDiff.TotalMilliseconds); // wklyTime = new System.Threading.Timer(dispatchWklyReport, wklyRepSchd, runInterval, System.Threading.Timeout.Infinite); // } // } }
private void dailyReportInvoker(BCCReportScheduleStruct dlyRepSchd) { // Set the year, month and day to today dlyRepSchd.Year= dtCurrent.Year.ToString(); dlyRepSchd.Month = dtCurrent.Month.ToString(); dlyRepSchd.Day = dtCurrent.Day.ToString(); Int32 runInterval = 0; // Create actual report schedule date. DateTime dtScheduled = new DateTime(Int32.Parse(dlyRepSchd.Year), Int32.Parse(dlyRepSchd.Month), Int32.Parse(dlyRepSchd.Day), Int32.Parse(dlyRepSchd.HH), Int32.Parse(dlyRepSchd.MI), 0); if ( dtScheduled.CompareTo(dtCurrent) > 0) { System.TimeSpan timeDiff = dtScheduled.Subtract(dtCurrent); if ((timeDiff.TotalMilliseconds < INTERVAL) || (timeDiff.TotalMilliseconds == 0)) { runInterval = Convert.ToInt32(timeDiff.TotalMilliseconds); if (htReptSignals == null) { htReptSignals = new Hashtable(); } if (!htReptSignals.Contains(dlyRepSchd.HubRepSchdId.ToString())) { dlyTime = new System.Threading.Timer(dispatchDlyReport, dlyRepSchd, runInterval, System.Threading.Timeout.Infinite); htReptSignals.Add(dlyRepSchd.HubRepSchdId.ToString(), "Y"); } } } }