private Job GetExistingGlobalJob() { var viewModel = new GlobalJobViewModel(); var jobId = Database.Instance.GetGlobalJobId(); if (!string.IsNullOrEmpty(jobId)) { return JobManager.Instance.GetJob(jobId); } else { return null; } }
public ActionResult GlobalJob() { var viewModel = new GlobalJobViewModel(); var globalJob = GetExistingGlobalJob(); if (globalJob != null && globalJob.IsComplete) { Database.Instance.StoreGlobalJobId(""); } else { viewModel.Job = globalJob; } return View(viewModel); }