Exemplo n.º 1
0
        public void MarkAsCompleted(DateTime dateOfCompletion)
        {
            if (this.DateOfStart > dateOfCompletion)
            {
                throw new ArgumentException("The date of completion cannot precede the date of start.", "dateOfCompletion");
            }
            if (this.IsCompleted)
            {
                throw new InvalidOperationException("The Job Order has already been marked as completed");
            }

            var @event = new TimeAndMaterialJobOrderCompletedEvent(
                this.Id,
                dateOfCompletion
            );
            RaiseEvent(@event);
        }
Exemplo n.º 2
0
 public void Apply(TimeAndMaterialJobOrderCompletedEvent evt)
 { 
     this.DateOfCompletion = evt.DateOfCompletion;
     this.IsCompleted = true;        
 }