private void btnEditUsers_Click(object sender, EventArgs e) { if (dgwUsers.SelectedRows.Count > 0) { User u = new User(); // userD.lblCustomer.Text = "Modificar Datos Clientes"; u.Id = Convert.ToInt16(dgwUsers.CurrentRow.Cells["Id"].Value); u.LastName = dgwUsers.CurrentRow.Cells["Nombre Completo"].Value.ToString(); u.Username = dgwUsers.CurrentRow.Cells["Usuario"].Value.ToString(); u.Password = dgwUsers.CurrentRow.Cells["Contraseña"].Value.ToString(); u.RolCode = WorkUser.getRolByName(dgwUsers.CurrentRow.Cells[4].Value.ToString()); AddOrUpdateUserForm form = new AddOrUpdateUserForm(u, true, this); form.Show(); } else { MessageBox.Show("Seleccione una fila!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnInsert_Click(object sender, EventArgs e) { AddOrUpdateUserForm form = new AddOrUpdateUserForm(this); form.Show(); }