예제 #1
0
 private void CurrentApplication_AccountTransactionDeleted(object sender, AccountTransactionEventArgs e)
 {
     // If the deleted transaction's source transaction is in the list, then update the highlights
     foreach (DataGridViewRow row in transactionsDataGridView.Rows)
     {
         if (((int)row.Cells[CashBookTransaction.fVerificationNo].Value == e.VerificationNo))
         {
             UpdateRowHighlights(e);
             return;
         }
     }
 }
예제 #2
0
        private void UpdateRowHighlights(AccountTransactionEventArgs e)
        {
            foreach (DataGridViewRow row in transactionsDataGridView.Rows)
            {
                if ((int)row.Cells[AccountTransaction.fNo].Value == e.VerificationNo)
                {
                    using (var core = new StandardBusinessLayer(DataCache)) {
                        core.Connect();
                        UnbalancedVerificationNumbers = DataCache.GetUnbalancedAndEmptyVerifications().Select(v => v.No).ToArray(); //core.GetUnbalancedVerificationNumbers();
                    }

                    UpdateRowHighlightsNoDatabase(ApplicationEvents.LastCashBookTransactionSelectionChangedEventArgs);
                }
            }
        }
예제 #3
0
        private void UpdateRowHighlightsNoDatabase(AccountTransactionEventArgs e)
        {
            if (e != null)
            {
                foreach (DataGridViewRow row in transactionsDataGridView.Rows)
                {
                    if ((int)row.Cells[CashBookTransaction.fVerificationNo].Value == e.VerificationNo)
                    {
                        row.DefaultCellStyle = new DataGridViewCellStyle()
                        {
                            ForeColor = System.Drawing.Color.Blue
                        };
                    }
                    else
                    {
                        row.DefaultCellStyle = new DataGridViewCellStyle()
                        {
                            ForeColor = System.Drawing.Color.Black
                        };
                    }
                }
            }

            if (UnbalancedVerificationNumbers != null)
            {
                foreach (DataGridViewRow row in transactionsDataGridView.Rows)
                {
                    if (UnbalancedVerificationNumbers.Contains((int)row.Cells[CashBookTransaction.fVerificationNo].Value))
                    {
                        row.DefaultCellStyle = new DataGridViewCellStyle()
                        {
                            ForeColor = System.Drawing.Color.Red
                        };
                    }
                }
            }
        }
예제 #4
0
        void CurrentApplication_AccountTransactionDeleted(object sender, AccountTransactionEventArgs e)
        {
            // If the deleted transaction is in the list, then reload the grid.

            foreach (DataGridViewRow row in transactionsDataGridView.Rows)
            {
                if ((int)row.Cells[AccountTransaction.fNo].Value == e.AccountTransactionNo)
                {
                    LoadTransactionGrid();
                    return;
                }
            }

            // If the deleted transaction's verification is represented in the list, then update the highlights

            foreach (DataGridViewRow row in transactionsDataGridView.Rows)
            {
                if ((int)row.Cells[AccountTransaction.fVerificationNo].Value == (int)e.VerificationNo)
                {
                    UpdateRowHighlights(ApplicationEvents.LastCashBookTransactionSelectionChangedEventArgs);
                    return;
                }
            }
        }
예제 #5
0
 void CurrentApplication_AccountTransactionCreated(object sender, AccountTransactionEventArgs e)
 {
     UpdateRowHighlights(e);
 }
예제 #6
0
 private void CurrentApplication_AccountTransactionUpdated(object sender, AccountTransactionEventArgs e)
 {
     // If the updated transaction is in the list, then update the row highlights.
     UpdateRowHighlights(e);
 }
예제 #7
0
 private void CurrentApplication_AccountTransactionCreated(object sender, AccountTransactionEventArgs e)
 {
     UpdateRowHighlights(ApplicationEvents.LastAccountTransactionSelectionChangedEventArgs);
 }
예제 #8
0
 private void CurrentApplication_AccountTransactionSelectionChanged(object sender, AccountTransactionEventArgs e)
 {
     UpdateRowHighlightsNoDatabase(e);
 }