コード例 #1
0
ファイル: NewSaleEntered.cs プロジェクト: Daskul/BIG
 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;
 }
コード例 #2
0
ファイル: Sale.cs プロジェクト: Daskul/BIG
        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));
        }