private void TBNumero_Validating(object sender, CancelEventArgs e) { try { Viajes _unInternacional = null; _unInternacional = new AppWinAdministracion.WSTerminalRef.WSTerminal().Buscar_Viaje(Convert.ToInt32(TBNumero.Text)); if (_unInternacional == null) { this.ActivoAgregar(); } else if (_unInternacional is Nacionales) { LblError.Text = "El viaje ingresado corresponde a un viaje nacional"; } else { _objInternacional = (Internacionales)_unInternacional; this.ActivoActualizacion(); } } catch (System.Web.Services.Protocols.SoapException ex) { int aux = ex.Message.IndexOf("ERROR: "); LblError.Text = ex.Message.Substring(aux, 80); } catch (Exception ex) { if (ex.Message.Length > 80) { LblError.Text = ex.Message.Substring(0, 80); } else { LblError.Text = ex.Message; } } }
private void TBCodigo_Validating(object sender, CancelEventArgs e) { try { Terminales _unaTerminal = null; _unaTerminal = new AppWinAdministracion.WSTerminalRef.WSTerminal().Buscar_Terminal(TBCodigo.Text); if (_unaTerminal == null) { this.ActivoAgregar(); } else { _objTerminal = _unaTerminal; this.ActivoActualizacion(); } } catch (System.Web.Services.Protocols.SoapException ex) { int aux = ex.Message.IndexOf("ERROR: "); LblError.Text = ex.Message.Substring(aux, 80); } catch (Exception ex) { if (ex.Message.Length > 80) { LblError.Text = ex.Message.Substring(0, 80); } else { LblError.Text = ex.Message; } } }
public void VerificoIngreso(object sender, EventArgs e) { try { Empleados _unEmpleado = new AppWinAdministracion.WSTerminalRef.WSTerminal().Login(Convert.ToString(ControladorLogin.Usuario), ControladorLogin.Contraseña); if (_unEmpleado == null) { LblError.Text = "Cédula o Contraseña Inválidos"; } else { this.Hide(); Form _unForm = new FrmPrincipal(_unEmpleado); _unForm.ShowDialog(); this.Close(); } } catch (System.Web.Services.Protocols.SoapException ex) { int aux = ex.Message.IndexOf("ERROR: "); LblError.Text = ex.Message.Substring(aux, 80); } catch (Exception ex) { if (ex.Message.Length > 40) { LblError.Text = ex.Message.Substring(0, 40); } else { LblError.Text = ex.Message; } } }