Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 5
0
 public ContentResult TriggerHRURun()
 {
     BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunHRURefreshJob());
     return(Content("HRU refresh will run in the background"));
 }
Exemplo n.º 6
0
 public ContentResult TriggerLGURun()
 {
     BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunLoadGeneratingUnitRefreshJob(null));
     return(Content("LGU refresh will run in the background"));
 }
Exemplo n.º 7
0
 public ActionResult DeltaSolve()
 {
     BackgroundJob.Enqueue(() => ScheduledBackgroundJobLaunchHelper.RunDeltaSolve());
     return(Content("Enqueued"));
 }
Exemplo n.º 8
0
 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));
 }