public Ux2CampaignService()
        {
            InitializeComponent();
            //this.cExcHandler = new GanoExceptionHandling(EXC_URL, cErrorFile);

            LoadSettings();

            if (!EventLog.SourceExists(EVENT_LOG_SOURCE))
                EventLog.CreateEventSource(EVENT_LOG_SOURCE, EVENT_LOG);

            try
            {
                this.cScheduleTimer = new System.Timers.Timer(this.cInterval);
                this.cScheduleTimer.Elapsed += new ElapsedEventHandler(cScheduleTimer_Elapsed);
                this.cScheduleTimer.Enabled = true;

                EventLog.WriteEntry(EVENT_LOG_SOURCE, "Ux2 Campaign Service Started on " + DateTime.Now.ToString() + "\n" +
                    "Settings loaded from " + Path.GetDirectoryName(Application.ExecutablePath) + "\\" + SETTINGS_FILE + "\n" +
                    "Processing Interval: " + this.cInterval + "ms\n" +
                    "Max Campaign Age: " + this.cMaxAge + "hours");

                this.cProcessor = new ScheduleProcessor(this.cConnectionString, cMaxAge);
                this.cProcessorCaller = new CallScheduleProcessor(this.cProcessor.ProcessSchedules);
            }
            catch (Exception exc)
            {
                //this.cExcHandler.LogExceptionQuiet(null, exc);
                EventLog.WriteEntry(EVENT_LOG_SOURCE, exc.Message);
            }
        }
예제 #2
0
 public void OnRunNowClick(object source, CommandEventArgs e)
 {
     try
     {
         Control control = source as Control;
         if (control != null)
         {
             HtmlTableRow tableRow = control.Parent.FindControl("lastRunTextRow") as HtmlTableRow;
             ShowHideLastRunInfo(tableRow, true);
         }
         DataItemService.RunNow(e.CommandArgument.ToString(), VisitHelper.GetVisit());
         if (ScheduleProcessor != null)
         {
             ScheduleProcessor.Wakeup();
         }
     }
     catch (Exception ex)
     {
         LOG.Error(ex.Message, ex);
         divPageError.Visible   = true;
         divPageError.InnerText = ExceptionUtils.GetDeepExceptionMessage(ex);
     }
 }