private void btnSearch_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; serviceDAA = new DBControllerWSClient(); usuario = serviceDAA.queryUserByUserName(txtUsername.Text); if (usuario.password != null) { ModifyUserForm updateForm1 = new ModifyUserForm(users[1]); updateForm1.currentUser = new user(); updateForm1.currentUser = usuario; updateForm1.SetParent(this); updateForm1.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("No existe el usuario con ese username"); } } catch { MessageBox.Show("Ocurrió un problema"); updateDataGridView(); } }
private void bntModifyUser_Click(object sender, EventArgs e) { ModifyUserForm modifyUserForm = new ModifyUserForm(); modifyUserForm.SetParent(this); modifyUserForm.ShowDialog(); }
private void bntModifyUser_Click(object sender, EventArgs e) { int i = dgvUser.CurrentCell.RowIndex; if (i >= 0) { ModifyUserForm modifyUserForm = new ModifyUserForm(users[i]); //modifyUserForm.usuario1 = new user(); modifyUserForm.currentUser = users[i]; modifyUserForm.SetParent(this); modifyUserForm.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("Seleccione un usuario"); } }