Exemple #1
0
        public bool IsEqualTo(object obj)
        {
            InComeMovement another = (InComeMovement)obj;
            bool           isSame  = this.Product.Id == another.Product.Id &&
                                     this.Price == another.Price &&
                                     this.MovementDate.DayOfYear == another.MovementDate.DayOfYear &&
                                     this.MovementDate.Year == another.MovementDate.Year;

            return(isSame);
        }
Exemple #2
0
        public int CompareTo(object obj)
        {
            InComeMovement another   = (InComeMovement)obj;
            bool           isSameDay = this.MovementDate.DayOfYear == another.MovementDate.DayOfYear &&
                                       this.MovementDate.Year == another.MovementDate.Year;

            if (isSameDay)
            {
                return(Decimal.Compare(this.Price, another.Price) * -1);
            }
            else
            {
                return(DateTime.Compare(this.MovementDate, another.MovementDate));
            }
        }