Пример #1
0
        private void btnAddLogin_Click(object sender, EventArgs e)
        {
            frmAddEditLogin f = new frmAddEditLogin();

            f.public_userID = _userID;
            f.public_isNew  = true;
            if (f.ShowDialog() == DialogResult.OK)
            {
                LoadLogins();
            }
        }
Пример #2
0
        //When we double click on a cell, we open the "Edit" functionality of the AddEditLogin
        private void dgvUserAccounts_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //Get the selected row
            int             selectedrowindex = dgvUserAccounts.SelectedCells[0].RowIndex;
            DataGridViewRow selectedRow      = dgvUserAccounts.Rows[selectedrowindex];

            frmAddEditLogin f = new frmAddEditLogin();

            f.public_userID    = _userID;
            f.public_isNew     = false;
            f.public_AccountID = Convert.ToInt32(selectedRow.Cells["AccountID"].Value.ToString());
            //If we get an "OK" on the edit, refresh the data
            if (f.ShowDialog() == DialogResult.OK)
            {
                LoadLogins();
            }
        }