public override bool Equals(object obj) { if (obj is FTDealer) { var ftDealer = obj as FTDealer; return(DealerName.Equals(ftDealer.DealerName, StringComparison.CurrentCultureIgnoreCase) && DealerNumber.Equals(ftDealer.DealerNumber, StringComparison.CurrentCultureIgnoreCase)); } return(false); }
public bool ExistIn(DealerPositionInfo another) { if (null == another) { return(false); } string date1 = TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); string date2 = another.TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); bool result = date1.Equals(date2) && Commodity.Equals(another.Commodity) && Month.Equals(another.Month); string dealerList = ""; if (result) { switch (DealerInformationType) { case InformationType.VolumeInfo: dealerList = another.VolumeDealers; break; case InformationType.BuyInfo: dealerList = another.BuyDealers; break; case InformationType.SellInfo: dealerList = another.SellDealers; break; } string dealer; int amount; ExtractDealer(Rank, dealerList, out dealer, out amount); result = DealerName.Equals(dealer) && Amount == amount; } return(result); }