private void button2_Click(object sender, EventArgs e) { this.Close(); INICIO_SESION inicio = new INICIO_SESION(); inicio.Show(); }
public void recuperarContra() { if (txtConfirmar.Text == "" || txtContrasenia.Text == "") { lblerror.Visible = true; lblerror.Text = "No Puede Dejar la Contraseña en Blanco!!"; lblerror.ForeColor = System.Drawing.Color.Red; } else { if (txtContrasenia.Text != txtConfirmar.Text) { lblerror.Visible = true; lblerror.Text = "Las Contraseñas no coinciden"; lblerror.ForeColor = System.Drawing.Color.Red; } else { conexion.enlace(); SqlCommand comando = new SqlCommand("Update empleados set contraseña_empleado = '" + txtContrasenia.Text + "' where usuario_empleado = '" + txtusuariorecu.Text + "'", conexion.enlace()); int filasAfectadas = comando.ExecuteNonQuery(); if (filasAfectadas != 0) { lblerror.Visible = false; MessageBox.Show("Contraseña Actualizada"); this.Hide(); INICIO_SESION regre = new INICIO_SESION(); regre.Show(); } else { MessageBox.Show("NO se Pudo hacer la Actualizacion,"); } } } }