public static void QueueLGURefreshForArea(DbGeometry oldShape, DbGeometry newShape) { DbGeometry loadGeneratingUnitRefreshAreaGeometry; if (oldShape == null && newShape == null) { throw new InvalidOperationException("At least one input to QueueLGURefreshForArea must not be null."); } if (oldShape == null) { loadGeneratingUnitRefreshAreaGeometry = newShape; } else if (newShape == null) { loadGeneratingUnitRefreshAreaGeometry = oldShape; } else { loadGeneratingUnitRefreshAreaGeometry = oldShape.Union(newShape); } var loadGeneratingUnitRefreshArea = new LoadGeneratingUnitRefreshArea(loadGeneratingUnitRefreshAreaGeometry); HttpRequestStorage.DatabaseEntities.LoadGeneratingUnitRefreshAreas.Add(loadGeneratingUnitRefreshArea); HttpRequestStorage.DatabaseEntities.SaveChanges(); BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunLoadGeneratingUnitRefreshJob(loadGeneratingUnitRefreshArea.LoadGeneratingUnitRefreshAreaID)); }
public ActionResult RefreshFromOCSurvey(ConfirmDialogFormViewModel viewModel) { if (!ModelState.IsValid) { return(ViewRefreshFromOCSurvey(viewModel)); } BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunRegionalSubbasinRefreshBackgroundJob(CurrentPerson.PersonID, false)); SetMessageForDisplay("Regional Subbasins refresh will run in the background."); return(new ModalDialogFormJsonResult()); }
public ActionResult CheckForDiscrepancies(ConfirmDialogFormViewModel viewModel) { if (!ModelState.IsValid) { return(ViewCheckForDiscrepancies(viewModel)); } BackgroundJob.Schedule(() => ScheduledBackgroundJobLaunchHelper.RunDelineationDiscrepancyCheckerJob(), TimeSpan.FromSeconds(1)); SetMessageForDisplay("The job to check BMP delineation discrepancies and overlaps has been queued. Please check back in a few minutes to see the new results."); return(new ModalDialogFormJsonResult()); }
public ActionResult RefreshHRUCharacteristics(ConfirmDialogFormViewModel viewModel) { if (!ModelState.IsValid) { return(ViewRefreshHRUCharacteristics(viewModel)); } BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunLoadGeneratingUnitRefreshJob(null)); BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunHRURefreshJob()); SetMessageForDisplay("HRU Characteristic refresh will run in the background."); return(new ModalDialogFormJsonResult()); }
public ContentResult TriggerHRURun() { BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunHRURefreshJob()); return(Content("HRU refresh will run in the background")); }
public ContentResult TriggerLGURun() { BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunLoadGeneratingUnitRefreshJob(null)); return(Content("LGU refresh will run in the background")); }
public ActionResult DeltaSolve() { BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunDeltaSolve()); return(Content("Enqueued")); }
public ContentResult RefreshAssessmentScores() { BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunRefreshAssessmentScoreJob(CurrentPerson.PersonID)); return(Content("Refresh will run in the background.")); }
public void UpdateModel(Person currentPerson) { BackgroundJob.Schedule(() => ScheduledBackgroundJobLaunchHelper.RunLandUseBlockUploadBackgroundJob(currentPerson.PersonID), TimeSpan.FromSeconds(30)); }