public int CompareTo(TransactionAdapter other)
        {
            if (0 != Amount.CompareTo(other.Amount))
            {
                return(Amount.CompareTo(other.Amount));
            }
            if (0 != Originator.CompareTo(other.Originator))
            {
                return(Originator.CompareTo(other.Originator));
            }
            if (0 != BeneficiaryName.CompareTo(other.BeneficiaryName))
            {
                return(BeneficiaryName.CompareTo(other.BeneficiaryName));
            }
            if (0 != BeneficiaryAccount.CompareTo(other.BeneficiaryAccount))
            {
                return(BeneficiaryAccount.CompareTo(other.BeneficiaryAccount));
            }
            if (0 != Currency.CompareTo(other.Currency))
            {
                return(Currency.CompareTo(other.Currency));
            }
            if (0 != ExecutionDate.CompareTo(other.ExecutionDate))
            {
                return(ExecutionDate.CompareTo(other.ExecutionDate));
            }
            if (0 != RemittanceInfo.CompareTo(other.RemittanceInfo))
            {
                return(RemittanceInfo.CompareTo(other.RemittanceInfo));
            }

            return(Transaction.CompareTo(other.Transaction));
        }
        internal void Grid_DuplicateRow(object sender, EventArgs e)
        {
            DataGridViewRow row = GetActiveRow();

            if (row != null)
            {
                TransactionAdapter ta = (TransactionAdapter)row.DataBoundItem;
                AddNewRow((TransactionAdapter)ta.Clone());
            }
        }
        public void AddNewRow(TransactionAdapter ta)
        {
            var bindingList = ((SortableBindingList <TransactionAdapter>)_dataGridView.DataSource);

            if (ta == null || ta.GranitXDocument == null)
            {
                bindingList.Add(_xmlToObject.AddEmptyTransactionRow());
            }
            else
            {
                bindingList.Add(_xmlToObject.AddTransactionRow(ta));
            }

            SelectLastRow();
        }
        private void RemoveRowAndTransaction(int rowIndex)
        {
            TransactionAdapter ta = (TransactionAdapter)_dataGridView.Rows[rowIndex].DataBoundItem;

            if (ta != null)
            {
                Debug.WriteLine(string.Format("Remove row at index: {0} transaction id: {1}", rowIndex, ta.TransactionId));
                _xmlToObject.RemoveTransactionRowById(ta.TransactionId);
                _dataGridView.Rows.RemoveAt(rowIndex);
            }
            else
            {
                throw new InvalidOperationException("No transaction found at row index " + rowIndex);
            }
        }
 public TransactionXElementParser(TransactionAdapter ta) : base(Constants.Transaction)
 {
     ParsedElement = Parse(ta.Transaction);
 }
        public object Clone()
        {
            TransactionAdapter clone = new TransactionAdapter((Transaction)Transaction.Clone(), GranitXDocument);

            return(clone);
        }