Пример #1
0
        private void UpdateRowHighlights(CashBookTransactionEventArgs e)
        {
            foreach (DataGridViewRow row in transactionsDataGridView.Rows)
            {
                if ((int)row.Cells[AccountTransaction.fVerificationNo].Value == e.VerificationNo)
                {
                    using (var core = new StandardBusinessLayer(DataCache)) {
                        core.Connect();
                        UnbalancedVerificationNumbers = DataCache.GetUnbalancedAndEmptyVerifications().Select(v => v.No).ToArray(); //core.GetUnbalancedVerificationNumbers();
                    }

                    UpdateRowHighlightsNoDatabase(ApplicationEvents.LastCashBookTransactionSelectionChangedEventArgs);
                }
            }
        }
Пример #2
0
        private void UpdateRowHighlightsNoDatabase(CashBookTransactionEventArgs e)
        {
            if (e != null)
            {
                foreach (DataGridViewRow row in transactionsDataGridView.Rows)
                {
                    if ((int)row.Cells[AccountTransaction.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[AccountTransaction.fVerificationNo].Value))
                    {
                        row.DefaultCellStyle = new DataGridViewCellStyle()
                        {
                            ForeColor = System.Drawing.Color.Red
                        };
                    }
                }
            }
        }
Пример #3
0
        void CurrentApplication_CashBookTransactionDeleted(object sender, CashBookTransactionEventArgs e)
        {
            // If the deleted transaction is in the list, then reload the grid.

            foreach (DataGridViewRow row in transactionsDataGridView.Rows)
            {
                if ((int)row.Cells[CashBookTransaction.fNo].Value == e.CashBookTransactionNo)
                {
                    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[CashBookTransaction.fVerificationNo].Value == (int)e.VerificationNo)
                {
                    UpdateRowHighlights(ApplicationEvents.LastAccountTransactionSelectionChangedEventArgs);
                    return;
                }
            }
        }
Пример #4
0
 void CurrentApplication_CashBookTransactionUpdated(object sender, CashBookTransactionEventArgs e)
 {
     // If the updated transaction is in the list, then update the row highlights.
     UpdateRowHighlights(e);
 }
Пример #5
0
 void ApplicationEvents_CashBookTransactionCreated(object sender, CashBookTransactionEventArgs e)
 {
     UpdateRowHighlights(e);
 }
Пример #6
0
 void CurrentApplication_CashBookTransactionSelectionChanged(object sender, CashBookTransactionEventArgs e)
 {
     UpdateRowHighlightsNoDatabase(e);
 }
Пример #7
0
 private void CurrentApplication_CashBookTransactionCreated(object sender, CashBookTransactionEventArgs e)
 {
     LoadTransactionGrid();
     SelectGridTransaction(e.CashBookTransactionNo);
 }