private void btCancelar_Click(object sender, EventArgs e) { if (xComprobantes != null) { xComprobantes.TangoLogoff(); xComprobantes = null; } Close(); }
/// <summary> /// Autentica en Tango /// Crea xComprobantes si no existe /// </summary> private void logueoATango() { if (xComprobantes == null) { xComprobantes = new xTangoComprobantes(); } ; if (xComprobantes.tangoLogOn != null) { xComprobantes.TangoLogoff(); changeStates(); } try { xComprobantes.TangoLogin(TxtKeyNumber.Text, TxtUser.Text, TxtPswd.Text, TxtCompany.Text); changeStates(); } catch (XTangoException ex) { MessageBox.Show("Ocurrio el error: " + ex.Message, "Facturacion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }