Beispiel #1
0
 public NewSaleEntered(
     Guid saleId,
     Guid customerId,
     ServiceType serviceType,
     decimal amount,
     DateTime date,
     Guid salesPersonId)
 {
     this.SaleId = saleId;
     this.CustomerId = customerId;
     this.ServiceType = serviceType;
     this.Amount = amount;
     this.Date = date;
     this.SalesPersonId = salesPersonId;
 }
Beispiel #2
0
        public Sale(Guid id, Guid customerId, ServiceType serviceType, decimal amount, Guid salesPersonId)
        {
            if (amount <= 0)
                throw new ArgumentException("Amount cannot be zero or negative number");

            this.Id = id;
            this.CustomerId = customerId;
            this.ServiceType = serviceType;
            this.Amount = amount;
            this.SalesPersonId = salesPersonId;

            this.Date = DateTime.Now;

            this.RaiseEvent(
                new NewSaleEntered(
                    this.Id,
                    this.CustomerId,
                    this.ServiceType,
                    this.Amount,
                    this.Date,
                    this.SalesPersonId));
        }