コード例 #1
0
        //Identify selected row value and open pre-populated form, ViewTransactions
        private void viewTransactionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable dTable = dgvAccounts.DataSource as DataTable;

            if (dTable != null && dTable.Rows.Count > 0)
            {
                DataGridViewRow dgvRow = dgvAccounts.CurrentRow;

                if (dgvRow != null)
                {
                    int AccountNumber = Convert.ToInt32(dgvRow.Cells[Convert.ToInt32(MainGridCloumns.AccountNumber)].Value);
                    int CustomerID    = Convert.ToInt32(dgvRow.Cells[Convert.ToInt32(MainGridCloumns.CustomerID)].Value);
                    using (ViewTransaction frmView = new ViewTransaction(AccountNumber))
                    {
                        frmView.ShowDialog();
                    }
                    PrimeGrid();
                }
                else
                {
                    MessageBox.Show("No Selection Made", "ERROR!");
                }
            }
        }
コード例 #2
0
        //Identify selected row value and open pre-populated form, ViewTransactions
        private void viewTransactionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable dTable = dgvAccounts.DataSource as DataTable;
            if (dTable != null && dTable.Rows.Count > 0)
            {
                DataGridViewRow dgvRow = dgvAccounts.CurrentRow;

                if (dgvRow != null)
                {
                    int AccountNumber = Convert.ToInt32(dgvRow.Cells[Convert.ToInt32(MainGridCloumns.AccountNumber)].Value);
                    int CustomerID = Convert.ToInt32(dgvRow.Cells[Convert.ToInt32(MainGridCloumns.CustomerID)].Value);
                    using (ViewTransaction frmView = new ViewTransaction(AccountNumber))
                    {
                        frmView.ShowDialog();
                    }
                    PrimeGrid();
                }
                else
                {
                    MessageBox.Show("No Selection Made", "ERROR!");
                }
            }
        }