private void _btnAceptar_Click(object sender, EventArgs e) { try { Connection.conn.Open(); Connection.Autenticar(_txtNombreUsuario.Text, _txtContrasena.Text); if (Connection.rol == -1) { MessageBox.Show("Error en los datos."); Connection.conn.Close(); } else if (Connection.rol == 0) { Connection.conn.Close(); Checador.RegistrarEntrada(); this.Hide(); } else { Connection.conn.Close(); this.Hide(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void Main_FormClosing(object sender, FormClosingEventArgs e) { if (Connection.rol == 0) { Checador.RegistrarSalida(); } //Generar Backup }