示例#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);
        }
示例#2
0
 public void Apply(TimeAndMaterialJobOrderCompletedEvent evt)
 { 
     this.DateOfCompletion = evt.DateOfCompletion;
     this.IsCompleted = true;        
 }