示例#1
0
        public ActionResult Index()
        {
            // clear the store that is set in the Base Controller
            System.Web.HttpContext.Current.Session["currentStore"] = null;
            ViewBag.Store = null;

            // start Quartz Scheduler Job
            JobSchedulerController JS = new JobSchedulerController();

            JS.Start();

            return(View(db.tbl_Stores.Where(x => x.Active == true).ToList()));
        }
示例#2
0
        // to run the Daily Update Job manually
        public ActionResult DailyUpdate()
        {
            JobSchedulerController JS = new JobSchedulerController();

            if (JS.DailyUpdateAlgorithm(true))
            {
                // ran successfully
                return(RedirectToAction("Admin", "Home", new { message = "Daily Update Successfully Run!" }));
            }
            else
            {
                // failed to complete
                tbl_DailyUpdateLog log = db.tbl_DailyUpdateLog.OrderByDescending(x => x.DateTime).FirstOrDefault();
                string             msg = "Daily Update Failed! Only runs once per day! Last Run: " + log.DateTime;
                return(RedirectToAction("Admin", "Home", new { message = msg }));
            }
        }
示例#3
0
 public async Task Execute(IJobExecutionContext context)
 {
     JobSchedulerController JS = new JobSchedulerController();
     bool run = JS.DailyUpdateAlgorithm(false);
 }