internal override void Finished(Calculation calculation, IJobIndexPointCalculator calculator)
 {
     if (calculator.CalculatorSession.HasEmployeeCalculationFailed)
     {
         calculation.State = new CalculationNotCompletedState();
     }
     else
     {
         calculation.State = new CalculationCompletedState();
     }
 }
Beispiel #2
0
        public void UpdateCalculationResult(Calculation calculation, CalculationProgress progress,
                                            IJobIndexPointCalculator calculator, List <string> messages)
        {
            using (var transaction = new TransactionScope())
            {
                var calc = calcRep.GetById(calculation.Id);

                if (progress.LastCalculatedEmployeeId != null)
                {
                    calc.UpdateCalculationResult(progress.TotalItem, progress.ItemsCalculated, messages, progress.LastCalculatedPath.Value, empRep.GetBy(progress.LastCalculatedEmployeeId));
                }
                else
                {
                    calc.UpdateCalculationResult(progress.TotalItem, progress.ItemsCalculated, messages);
                }

                calc.Finish(calculator);
                transaction.Complete();
            }
        }
Beispiel #3
0
 internal virtual void Pause(Calculation calculation, IJobIndexPointCalculator calculator)
 {
     throw new ClaimInvalidStateOperationException("Calculation", DisplayName, "Pause");
 }
Beispiel #4
0
 public virtual void Finish(IJobIndexPointCalculator calculator)
 {
     state.Finished(this, calculator);
 }
Beispiel #5
0
 public virtual void Stop(IJobIndexPointCalculator calculator)
 {
     State.Stop(this, calculator);
 }
Beispiel #6
0
 public virtual void Pause(IJobIndexPointCalculator calculator)
 {
     State.Pause(this, calculator);
 }
Beispiel #7
0
 public virtual void Run(IJobIndexPointCalculator calculator)
 {
     State.Run(this, calculator);
 }
 internal override void Stop(Calculation calculation, IJobIndexPointCalculator calculator)
 {
     calculator.Stop(calculation);
     calculation.State = new CalculationStoppedState();
 }
 internal override void Pause(Calculation calculation, IJobIndexPointCalculator calculator)
 {
     calculator.Pause(calculation);
     calculation.State = new CalculationPausedState();
 }
Beispiel #10
0
 internal override void Run(Calculation calculation, IJobIndexPointCalculator calculator)
 {
     calculator.Start(calculation);
     calculation.State = new CalculationRunningState();
 }