コード例 #1
0
        public int CompareTo(Transaction other)
        {
            if (other == null)
            {
                return(-1);
            }

            if (IsSelected != other.IsSelected)
            {
                return(-2);
            }

            if (0 != Amount.CompareTo(other.Amount))
            {
                return(Amount.CompareTo(other.Amount));
            }
            if (0 != Originator.CompareTo(other.Originator))
            {
                return(Originator.CompareTo(other.Originator));
            }
            if (0 != Beneficiary.CompareTo(other.Beneficiary))
            {
                return(Beneficiary.CompareTo(other.Beneficiary));
            }
            if (0 != RequestedExecutionDate.CompareTo(other.RequestedExecutionDate))
            {
                return(RequestedExecutionDate.CompareTo(other.RequestedExecutionDate));
            }
            if (0 != RemittanceInfo.CompareTo(other.RemittanceInfo))
            {
                return(RemittanceInfo.CompareTo(other.RemittanceInfo));
            }

            return(0);
        }
コード例 #2
0
 public Transaction()
 {
     TransactionId          = ++NextTransactionId;
     IsSelected             = true;
     Originator             = new Originator();
     Beneficiary            = new Beneficiary();
     Amount                 = new Amount();
     RequestedExecutionDate = DateTime.Today.ToString(GranitXml.Constants.DateFormat);
     RemittanceInfo         = new RemittanceInfo();
 }
コード例 #3
0
        public object Clone()
        {
            Transaction clone = new Transaction
            {
                IsSelected             = IsSelected,
                Amount                 = (Amount)Amount.Clone(),
                Beneficiary            = (Beneficiary)Beneficiary.Clone(),
                Originator             = (Originator)Originator.Clone(),
                RequestedExecutionDate = RequestedExecutionDate,
                RemittanceInfo         = (RemittanceInfo)RemittanceInfo.Clone()
            };

            return(clone);
        }