예제 #1
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (!(obj is InvoiceItemAdded))
            {
                return(false);
            }

            InvoiceItemAdded e = (InvoiceItemAdded)obj;

            return(this.OwnerId == e.OwnerId &&
                   this.UserName == e.UserName &&
                   this.InvoiceId == e.InvoiceId &&
                   this.ItemId == e.ItemId &&
                   this.Description == e.Description &&
                   this.Quantity == e.Quantity &&
                   this.Price == e.Price &&
                   this.DiscountInPercent == e.DiscountInPercent &&
                   this.DiscountAmount == e.DiscountAmount &&
                   this.Total == e.Total &&
                   this.TaxCode == e.TaxCode &&
                   this.TaxAmount == e.TaxAmount &&
                   this.Summary.Equals(e.Summary) &&
                   this.ItemNumber == e.ItemNumber);
        }
예제 #2
0
파일: Invoice.cs 프로젝트: dnywu/sales
 private void OnInvoiceItemAdded(InvoiceItemAdded @event)
 {
     _subTotal = @event.Summary.SubTotal;
     _nextItemNumber = @event.ItemNumber;
     _taxes = new Dictionary<string, TaxSummary>();
     foreach (TaxSummary taxSummary in @event.Summary.Taxes)
         _taxes.Add(taxSummary.TaxCode, taxSummary);
 }