示例#1
0
        internal override WorkReport Work(Hour currentHour, Member member)
        {
            CaseWorker worker = _caseBoard.FirstOrDefault(x => x.Member == member);

            if (worker == null)
            {
                throw new InvalidOperationException($"{member} is not allocated to this case.");
            }

            if (_workerQueue.Count < 1)
            {
                throw new InvalidOperationException("No worker queued to do work.");
            }

            if (!_work[member].IsStarted)
            {
                Log.LogStarted(currentHour, this as dynamic, worker as dynamic);
            }

            if (_work[member].IsFinished)
            {
                return(new NullWorkReport());
            }
            else
            {
                _work[member].DoWork();
                if (_work[member].IsFinished)
                {
                    Log.LogFinished(currentHour, this as dynamic, worker as dynamic);
                }

                return(new WorkReport(this as dynamic));
            }
        }
示例#2
0
 internal void LogEnqueued(Hour hour, OPCase workCase, CaseWorker worker)
 {
     _checkIsNotAlreadyLogged(OPEnqueuedChair);
     _checkIsNotAlreadyLogged(OPEnqueuedRapporteur);
     _checkIsNotAlreadyLogged(OPEnqueuedSecondMember);
     OPEnqueuedChair = hour;
     OPEnqueuedRapporteur = hour;
     OPEnqueuedSecondMember = hour;
 }        
示例#3
0
 protected abstract int _getWorkHours(CaseWorker worker);
示例#4
0
 protected override int _getWorkHours(CaseWorker worker)
 {
     return(worker.HoursOPPreparation + TimeParameters.OPDurationInHours);
 }
示例#5
0
 protected override int _getWorkHours(CaseWorker worker)
 {
     return(worker.HoursForDecision);
 }
示例#6
0
 protected override int _getWorkHours(CaseWorker worker)
 {
     return(worker.HoursForSummons);
 }
示例#7
0
 internal void LogFinished(Hour hour, WorkCase workCase, CaseWorker worker)
 { }
示例#8
0
 internal void LogStarted(Hour hour, WorkCase workCase, CaseWorker worker)
 { }
示例#9
0
 internal void LogEnqueued(Hour hour, WorkCase workCase, CaseWorker worker)
 {  }