コード例 #1
0
ファイル: HomeController.cs プロジェクト: alt0077/GildedRose
        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
ファイル: ItemsController.cs プロジェクト: alt0077/GildedRose
        // 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);
 }