コード例 #1
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (!(obj is TaxSummary))
            {
                return(false);
            }

            TaxSummary e = (TaxSummary)obj;

            return(this.TaxCode == e.TaxCode &&
                   this.TaxAmount == e.TaxAmount);
        }
コード例 #2
0
ファイル: Invoice.cs プロジェクト: dnywu/sales
        private TaxSummary GetTaxSummary(string taxCode)
        {
            if (_taxes.ContainsKey(taxCode))
                return _taxes[taxCode];

            TaxSummary taxSummary = new TaxSummary { TaxCode = taxCode, TaxAmount =0 };
            _taxes.Add(taxCode, taxSummary);
            return taxSummary;
        }