/// <nodoc/> public static WorkspaceProgressEventArgs Create(ProgressStage progressStage, int numberOfProcessedSpecs, int?totalNumberOfSpecs = null) { return(new WorkspaceProgressEventArgs() { ProgressStage = progressStage, NumberOfProcessedSpecs = numberOfProcessedSpecs, TotalNumberOfSpecs = totalNumberOfSpecs }); }
private void UpdateScenarioProgress_VariableToMultipleCmdlet(ProgressStage stage, IObject obj) { if (stage == ProgressStage.PreLoop) { if (ProgressManager.PipelineContainsOperation) { if (!ProgressManager.LastInChain) { SetObjectSearchProgress(ProcessingOperation.Processing); } if (ProgressManager.ExpectsContainsProgress) { ProgressManager.RemovePreviousOperation(); } } } else if (stage == ProgressStage.BeforeEach) { //When a variable to cmdlet chain contains an operation, responsibility of updating the number of records processed //"resets", and we become responsible for updating our own count again. If that operation was a multi operation cmdlet //operating in both batch and paass through mode however, we're still acting as if we've piped from a variable if (ProgressManager.PipelineContainsOperation && ProgressManager.ExpectsContainsProgress && !ProgressManager.PipeFromPrtgCmdletPostProcessMode) { ProgressManager.UpdateRecordsProcessed(ProgressManager.CurrentRecord, obj); } } else //PostLoop { UpdateScenarioProgress_VariableToSingleCmdlet(stage); } }
private void UpdateScenarioProgress_MultipleCmdlets(ProgressStage stage, IObject obj) { if (ProgressManager.ExpectsContainsProgress) { if (stage == ProgressStage.PreLoop) { ProgressManager.RemovePreviousOperation(); } else if (stage == ProgressStage.BeforeEach) { if (!ProgressManager.PipeFromPrtgCmdletPostProcessMode) { ProgressManager.UpdateRecordsProcessed(ProgressManager.CurrentRecord, obj); } } else //PostLoop { ProgressManager.CompleteProgress(); } } if (stage == ProgressStage.PostLoop) { ProgressManager.MaybeCompletePreviousProgress(); } }
public ActionResult CreateProgressStage(ProgressStageViewModel viewModel) { if (!ModelState.IsValid) { ModelState.AddModelError("", "ProgressStageProblem"); return(View()); //Redirect tek nje error page } ProgressStage progressStage = new ProgressStage() { Stage = viewModel.Stage, Value = viewModel.Value, DateCompleted = DateTime.Now, CompletedBy = viewModel.CompletedBy, DateApproved = DateTime.Now.AddMonths(3), //ask ApprovedBy = viewModel.ApprovedBy, PaymentStatus = viewModel.PaymentStatus, DatePaid = DateTime.Now }; _context.ProgressStages.Add(progressStage); _context.SaveChanges(); return(View()); }
/// <summary> /// Displays a list of buckets for the passed customer and bucket status /// </summary> /// <param name="customerId"></param> /// <param name="stateIndex"></param> public IndexViewModel(string customerId, ProgressStage state, string userName) { this.CustomerId = customerId; this.Buckets = new BucketModel[0]; this.BucketState = state; this.UserName = userName; }
public void UpdateProgress(ProgressStage progressStage, int maxValue, int currentValue) { if (this.Progress != null) { this.Progress(this, new PackageProgressEventArgs(progressStage, maxValue, currentValue)); } }
/// <summary> /// Constructor /// </summary> /// <param name="name"></param> /// <param name="lower"></param> /// <param name="upper"></param> /// <param name="position"></param> /// <param name="stage"></param> public ProgressItem(string name, int lower, int upper, int position, ProgressStage stage) { m_name = name; m_lower = lower; m_upper = upper; m_position = position; m_done = false; m_stage = stage; }
private void UpdateScenarioProgress_VariableToSingleCmdlet(ProgressStage stage) { if (stage == ProgressStage.PreLoop) { } else if (stage == ProgressStage.BeforeEach) { } else //PostLoop { if (ProgressManager.ExpectsContainsProgress) { ProgressManager.CompleteProgress(); } } }
public virtual ActionResult Index(string customerId, ProgressStage bucketState, string userName) { var buckets = _service.GetBuckets(customerId, bucketState, userName); var model = new IndexViewModel(); // Null DC Cancel dates display last model.Buckets = (from bucket in buckets.Select(p => new BucketModel(p)) orderby bucket.PriorityId descending, bucket.DcCancelDateRange.From ?? DateTime.MaxValue, bucket.PercentPiecesComplete descending select bucket).ToArray(); if (!buckets.Any()) { return(View(Views.Index, model)); } if (!string.IsNullOrWhiteSpace(model.CustomerId)) { model.CustomerName = _service.GetCustomer(model.CustomerId) == null ? "" : _service.GetCustomer(model.CustomerId).Name; } return(View(Views.Index, model)); }
/// <summary> /// All parameters are optional. If none are specified, all buckets will be retrieved /// which is definitely what you will not want. /// </summary> /// <param name="customerId"></param> /// <param name="state"></param> /// <returns></returns> internal IEnumerable <Bucket> GetBuckets(string customerId, ProgressStage state, string userName) { return(_repos.GetBuckets(customerId, state, userName)); }
public PackageProgressEventArgs(ProgressStage progressStage, int maxValue, int currentValue) { this.ProgressStage = progressStage; this.MaxValue = maxValue; this.CurrentValue = currentValue; }
private void UpdateJobProgress(UploadJob job, ProgressStage stage) { job.ProgressStage = stage; _jobRepository.UpdateJob(job); }
public BlindSearchProgressReport(ProgressStage Stage, double Progress, string Message = "") { this.Stage = Stage; this.Progress = Progress; this.Message = Message; }