public void Execute() { lock (_lock) { if (_shuttingDown) return; CheckForCompletedReviews checkall = new CheckForCompletedReviews(); checkall.Check(); TaskLog logItem = new TaskLog(); logItem.SuccessDatestamp = DateTime.Now; logItem.TaskDescription = "AllReviewsChecked"; db.TaskLog.Add(logItem); db.SaveChanges(); } }
public ActionResult Index() { string userId = User.Identity.Name; Customer selectedCust = (from cust in db.Customers where cust.CustomerID.Equals(userId) select cust).First(); CheckForCompletedReviews check = new CheckForCompletedReviews(selectedCust); check.Check(); selectedCust.LastReviewCheck = DateTime.Now; db.Entry(selectedCust).State = EntityState.Modified; db.SaveChanges(); return View(selectedCust); }
//This will check ALL open reviews to see if they have been completed. //Need to have this run at like 2 am or something because it can take a while to complete depending on //number of open reviews. There are no links to this...URL entered directly in bar will activate it. public ActionResult CheckAllReviews() { CheckForCompletedReviews checkall = new CheckForCompletedReviews(); checkall.Check(); TaskLog logItem = new TaskLog(); logItem.SuccessDatestamp = DateTime.Now; logItem.TaskDescription = "AllReviewsChecked"; db.TaskLog.Add(logItem); db.SaveChanges(); return View(); }