示例#1
0
 /// <summary>
 /// Determines a UI event based on the current "actions" selection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CbActions_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CbActions.Text == "Add a Customer Account")
     {
         using (var frmManageCustomerAccount = new FrmManageCustomerAccount(ManageAction.Add, null))
         {
             frmManageCustomerAccount.ShowDialog();
             if (frmManageCustomerAccount.ActionCommitted)
             {
                 BindCustomerAccountsGrid();
             }
             InitializeActionsComboBox();
         }
     }
     else if (CbActions.Text == "Exit")
     {
         if (MessageBox.Show("Are you sure you want to exit?", "Exit Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             //Close the application
             Close();
         }
         else
         {
             InitializeActionsComboBox();
         }
     }
 }
示例#2
0
        /// <summary>
        /// Opens the currently selected row in detail mode
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GvCustomerAccounts_DoubleClick(object sender, EventArgs e)
        {
            var currentRow = GvCustomerAccounts.CurrentRow;

            if (currentRow != null)
            {
                using (var frmManageCustomerAccount = new FrmManageCustomerAccount(ManageAction.Update, Guid.Parse(currentRow.Cells[0].Value.ToString())))
                {
                    frmManageCustomerAccount.ShowDialog();
                    if (frmManageCustomerAccount.ActionCommitted)
                    {
                        BindCustomerAccountsGrid();
                    }
                }
            }
        }