Пример #1
0
        private void editUser_button_Click(object sender, EventArgs e)
        {
            User editUser = new User(Convert.ToInt32(userList_dataGridView.SelectedRows[0].Cells["idDataGridViewTextBoxColumn"].Value),
                                     userList_dataGridView.SelectedRows[0].Cells["loginDataGridViewTextBoxColumn"].Value.ToString(),
                                     userList_dataGridView.SelectedRows[0].Cells["passwordDataGridViewTextBoxColumn"].Value.ToString(),
                                     userList_dataGridView.SelectedRows[0].Cells["roleDataGridViewTextBoxColumn"].Value.ToString());

            if (editUser.ID == user.ID)
            {
                MyProfileForm MPF = new MyProfileForm(user, menuItem);
                MPF.MdiParent = this.MdiParent;
                Container container = this.MdiParent as Container;
                container.MakeFormHooks(MPF);
                MPF.Show();
                this.Close();
            }
            else
            {
                EditUserForm EUF = new EditUserForm(editUser, user);
                EUF.ShowDialog();
                this.v_usersTableAdapter.Fill(this.monamurDBDataSet.V_users);
            }
        }