예제 #1
0
 public void Apply(TimeAndMaterialJobOrderRegisteredEvent evt)
 {
     Id = evt.JobOrderId;
     Customer = new CustomerInfo(evt.CustomerId, evt.CustomerName);
     Manager = new ManagerInfo(evt.ManagerId, evt.ManagerName);
     Value = new PositiveMoney(evt.Value, evt.Currency);
     DateOfStart = evt.DateOfStart;
     DateOfExpiration = evt.DateOfExpiration;
     Name = evt.JobOrderName;
     Number = evt.JobOrderNumber; 
     IsCompleted = false;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Description = evt.Description;
 }
예제 #2
0
 public static TimeAndMaterialJobOrder CreateNewInstance(IJobOrderNumberGenerator jobOrderNumberGenerator, Guid customerId, string customerName, Guid managerId, string managerName, decimal value, string currency, DateTime dateOfStart, DateTime? dateOfExpiration, string name, string purchaseOrderNumber, string description)
 {
     var @event = new TimeAndMaterialJobOrderRegisteredEvent(
         Guid.NewGuid(),
         customerId,
         customerName,
         managerId,
         managerName,
         value,
         currency,
         dateOfStart,
         dateOfExpiration,
         name,
         jobOrderNumberGenerator.Generate(),
         purchaseOrderNumber,
         description
         );
     var jobOrder = new TimeAndMaterialJobOrder(); 
     jobOrder.RaiseEvent(@event);
     return jobOrder;
 }