Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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;
        }