示例#1
0
        private void userAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UserAccountForm uaf = new UserAccountForm();

            uaf.MdiParent = this;
            uaf.Show();
        }
        private void tsbAddUser_Click(object sender, EventArgs e)
        {
            UserAccountForm uaf = new UserAccountForm();

            uaf.TopLevel  = false;
            uaf.MdiParent = this.MdiParent;
            uaf.Show();
        }
        private void dgvUserAccount_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int         rowIndex = e.RowIndex;
            UserAccount user;

            if (rowIndex >= 0)
            {
                user = GetUser(dgvUserAccount.Rows[rowIndex]);
                if (user != null)
                {
                    UserAccountForm uaf = new UserAccountForm(user);
                    uaf.TopLevel  = false;
                    uaf.MdiParent = this.MdiParent;
                    uaf.Show();
                }
            }
        }
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dgvUserAccount.SelectedRows.Count > 0)
            {
                var row = dgvUserAccount.SelectedRows[0].Index;

                if (row >= 0)
                {
                    var user = GetUser(dgvUserAccount.Rows[row]);
                    if (user != null)
                    {
                        UserAccountForm uaf = new UserAccountForm(user);
                        uaf.TopLevel  = false;
                        uaf.MdiParent = this.MdiParent;
                        uaf.Show();
                    }
                }
            }
        }