示例#1
0
        private void kullanıcıDüzenlemeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditUserForm editUserForm = new EditUserForm();

            editUserForm.MdiParent   = this;
            editUserForm.WindowState = FormWindowState.Maximized;
            editUserForm.Show();
        }
示例#2
0
        private void ChangeUserButton_Click(object sender, EventArgs e)
        {
            if (UserListBox.SelectedItem == null)
            {
                return;
            }
            User         user         = (User)UserListBox.SelectedItem;
            EditUserForm editUserForm = new EditUserForm(user);

            editUserForm.Show();
        }
示例#3
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (UserDataGrid.SelectedRows.Count > 0)
            {
                EditUserForm edit = new EditUserForm(this);

                edit.txtId.Text        = UserDataGrid.CurrentRow.Cells[0].Value.ToString();
                edit.txtNombre.Text    = UserDataGrid.CurrentRow.Cells[1].Value.ToString();
                edit.txtUserName.Text  = UserDataGrid.CurrentRow.Cells[2].Value.ToString();
                edit.txtpass.Text      = UserDataGrid.CurrentRow.Cells[3].Value.ToString();
                edit.txtpassconfi.Text = UserDataGrid.CurrentRow.Cells[3].Value.ToString();
                edit.TiposUsuario.Text = UserDataGrid.CurrentRow.Cells[4].Value.ToString();


                edit.Show();
            }
            else
            {
                MessageBox.Show("Debe de seleccionar el campo que quiere editar", "Seleccionar?", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void userGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (userGridView.Columns[e.ColumnIndex].Name == "Edit" && e.RowIndex != -1)
            {
                currentEditingUser = filteredUsers.ElementAt(e.RowIndex);

                EditUserForm editForm = new EditUserForm(
                    filteredUsers.ElementAt(e.RowIndex),
                    _role,
                    () => renderUsers());
                editForm.Show();
            }

            if (userGridView.Columns[e.ColumnIndex].Name == "Delete" && e.RowIndex != -1)
            {
                if (MessageBox.Show("Are you sure",
                                    "Message",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    DeleteUser(filteredUsers.ElementAt(e.RowIndex).Id);
                }
            }
        }