public ActionResult ActivateAlerterJob()
 {
     TopContractsCore.AlerterJobsService jsm = new TopContractsCore.AlerterJobsService();
     InfoPipe infoPipe = (InfoPipe)HttpContext.Session["InfoPipe"];
     jsm.ActivateAlerter(infoPipe.AppPrefs.OrganizationIdentifier);
     return null;
 }
        public ActionResult ActivateAlertsExtensionsJob(string input)
        {
            //This is to circumvent a problem in the action sent from the form... Needs to be fixed...
            input = input.Substring(1, input.IndexOf("_") - 1);

            //JobsServiceManager jsm = new JobsServiceManager();
            TopContractsCore.AlerterJobsService jobService = new TopContractsCore.AlerterJobsService();
            InfoPipe infoPipe = (InfoPipe)HttpContext.Session["InfoPipe"];
            jobService.ActivateAlerter(infoPipe.AppPrefs.OrganizationIdentifier, new Guid(input));
            return null;
        }
        public ActionResult PollAlerterJob()
        {
            //JobsServiceManager jsm = new JobsServiceManager();
            TopContractsCore.AlerterJobsService jobService = new TopContractsCore.AlerterJobsService();
            InfoPipe infoPipe = (InfoPipe)HttpContext.Session["InfoPipe"];
            long stid = jobService.PollAlerter(infoPipe.AppPrefs.OrganizationIdentifier);
            if (stid < 0)
            {
                System.Threading.Thread.Sleep(5000);
                RefreshInfoPipe();
                return null;
            }

            return Json(stid);
        }