示例#1
0
 /// <nodoc/>
 public static WorkspaceProgressEventArgs Create(ProgressStage progressStage, int numberOfProcessedSpecs, int?totalNumberOfSpecs = null)
 {
     return(new WorkspaceProgressEventArgs()
     {
         ProgressStage = progressStage, NumberOfProcessedSpecs = numberOfProcessedSpecs, TotalNumberOfSpecs = totalNumberOfSpecs
     });
 }
示例#2
0
        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);
            }
        }
示例#3
0
        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());
        }
示例#5
0
 /// <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;
 }
示例#6
0
 public void UpdateProgress(ProgressStage progressStage, int maxValue, int currentValue)
 {
     if (this.Progress != null)
     {
         this.Progress(this, new PackageProgressEventArgs(progressStage, maxValue, currentValue));
     }
 }
示例#7
0
 /// <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;
 }
示例#8
0
 private void UpdateScenarioProgress_VariableToSingleCmdlet(ProgressStage stage)
 {
     if (stage == ProgressStage.PreLoop)
     {
     }
     else if (stage == ProgressStage.BeforeEach)
     {
     }
     else //PostLoop
     {
         if (ProgressManager.ExpectsContainsProgress)
         {
             ProgressManager.CompleteProgress();
         }
     }
 }
示例#9
0
        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));
        }
示例#10
0
 /// <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;
 }
示例#12
0
 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);
 }
示例#14
0
 public BlindSearchProgressReport(ProgressStage Stage, double Progress, string Message = "")
 {
     this.Stage    = Stage;
     this.Progress = Progress;
     this.Message  = Message;
 }