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())); }
// 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 })); } }
public async Task Execute(IJobExecutionContext context) { JobSchedulerController JS = new JobSchedulerController(); bool run = JS.DailyUpdateAlgorithm(false); }