Esempio n. 1
0
        void SelectTransaction()
        {
            if (this.transactions == null || !this.transactions.HasTransactions)
            {
                throw new Exception("Cannot select a transaction right now");
            }

            selectedTransaction = this.transactions.Select(random.Next(0, this.transactions.Count));
            this.editedValues   = new TransactionDetails();
        }
Esempio n. 2
0
        void AddNewTransaction()
        {
            if (this.transactions == null)
            {
                throw new Exception("Cannot edit a transaction right now");
            }

            selectedTransaction = this.transactions.AddNew();
            this.editedValues   = new TransactionDetails();
            selectedTransaction.Select();
        }
Esempio n. 3
0
        void DeleteSelectedTransaction()
        {
            if (this.transactions == null || !this.transactions.HasTransactions)
            {
                throw new Exception("Cannot delete a transaction right now");
            }

            this.transactions.Delete(random.Next(0, this.transactions.Count));
            selectedTransaction = null;
            this.editedValues   = null;
        }
Esempio n. 4
0
        private void AssertSelectedTransaction()
        {
            if (transactions == null)
            {
                FocusTransactionView();
            }

            // caller is about to operate on this selection, so make sure it's up to date!
            if (this.selectedTransaction == null)
            {
                this.selectedTransaction = transactions.Selection;
                if (this.selectedTransaction == null)
                {
                    throw new Exception("No selected transaction");
                }
                if (this.editedValues == null)
                {
                    this.editedValues = new TransactionDetails();
                }
            }
        }
Esempio n. 5
0
        void FocusTransactionView()
        {
            window.CloseReport();
            this.transactions = window.FindTransactionGrid();
            window.WaitForInputIdle(200);

            var selection = this.transactions.Selection;

            if (selection == null && this.transactions.Count > 0)
            {
                this.transactions.Select(this.transactions.Count - 1);
                this.transactions.ScrollToEnd();
                selection = this.transactions.Selection;
            }
            if (selection != null)
            {
                selection.Focus();
            }
            this.selectedTransaction = selection;
            this.editedValues        = new TransactionDetails();
        }
Esempio n. 6
0
 void ClearTransactionViewState()
 {
     selectedTransaction = null;
     transactions        = null;
 }
Esempio n. 7
0
 void NavigateTransfer()
 {
     AssertSelectedTransaction();
     transactions.NavigateTransfer();
     this.selectedTransaction = transactions.Selection;
 }