protected void ButVerificar_Click(object sender, EventArgs e) { try { wsSeguridad.SeguridadSoapClient wsseg = new wsSeguridad.SeguridadSoapClient(); wsseg.ComprobarEstudiante(out Nombre, TextBoxId.Text); if (Nombre == "") { wsseg.ComprobarUsuarioAD(out Nombre, TextBoxId.Text); if (Nombre == "") { LabelNombre.Text = "Identificación no registrada"; LabelNombre.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000"); } else { LabelNombre.Text = "Nombre: " + Nombre; ButRegistrar.Enabled = true; } } else { LabelNombre.Text = "Nombre: " + Nombre; ButRegistrar.Enabled = true; } TextBoxId.Enabled = false; LabelNombre.Visible = true; } catch (Exception ex) { Response.Write("<SCRIPT>alert(''" + ex.Message +")</SCRIPT>"); } }
public Boolean iniciarSesionFuncionario(String IdUsuario, String Contrasena) { wsSeguridad.SeguridadSoapClient wsseg = new wsSeguridad.SeguridadSoapClient(); string Nombre = ""; wsseg.ComprobarUsuarioAD(out Nombre, IdUsuario); if (!Nombre.Equals("")) return true; return false; }
public void CrearTablaPrestamos() { String aDataSet = "["; foreach (DataRow prestamo in _prestamos.Rows) { String tipo = (prestamo["FK_IDTIPOPRESTAMO"].ToString() == "1") ? "Normal" : "Especial"; String nombre = ""; // Descomentar esta línea para realizar pruebas en ambiente de desarrollo // ---------------------------------------------------------------------- // nombre = "Mauricio Muñoz Chaves"; // ---------------------------------------------------------------------- // Comentar estas líneas para realizar pruebas en ambiente de desarrollo // --------------------------------------------------------------------- wsSeguridad.SeguridadSoapClient wsseg = new wsSeguridad.SeguridadSoapClient(); wsseg.ComprobarEstudiante(out nombre, prestamo["CAR_USUARIOGIMNASIO"].ToString()); if (nombre == "") { wsseg.ComprobarUsuarioAD(out nombre, prestamo["CAR_USUARIOGIMNASIO"].ToString()); if (nombre == "") { nombre = "Nombre desconocido"; } } // --------------------------------------------------------------------- aDataSet += "['" + prestamo["ID_PRESTAMO"] + "', '" + prestamo["CAR_USUARIOGIMNASIO"] + "', '" + nombre + "', '" + prestamo["FEC_PRESTAMO"] + "', '" + tipo + "', '" + prestamo["ESTADO"] + "'],"; } aDataSet = aDataSet.Remove(aDataSet.Length-1, 1); aDataSet += "]"; btnVerDetalle.Enabled = true; if (_prestamos.Rows.Count == 0) { aDataSet = "[]"; btnVerDetalle.Enabled = false; } if (!Page.ClientScript.IsStartupScriptRegistered("TablaPrestamos")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "TablaPrestamos", "<script type=\"text/javascript\"> CrearTablaPrestamos(" + aDataSet + ");</script>"); } }
private cSGMUUSUARIONegocios Verificar() { String nombre = ""; // Descomentar esta línea para realizar pruebas en ambiente de desarrollo // ---------------------------------------------------------------------- //nombre = "Mauricio Muñoz Chaves"; // ---------------------------------------------------------------------- // Comentar estas líneas para realizar pruebas en ambiente de desarrollo //--------------------------------------------------------------------- wsSeguridad.SeguridadSoapClient wsseg = new wsSeguridad.SeguridadSoapClient(); wsseg.ComprobarEstudiante(out nombre, txtIdentificacion.Text); if (nombre == "") { wsseg.ComprobarUsuarioAD(out nombre, txtIdentificacion.Text); if (nombre == "") { return null; } } // --------------------------------------------------------------------- cSGMUUSUARIONegocios usuarioSolicitante = new cSGMUUSUARIONegocios(Global.gCOD_APLICACION, "CA", 0, "0"); usuarioSolicitante.CAR_USUARIO = txtIdentificacion.Text; usuarioSolicitante.NOM_USUARIO = nombre; return usuarioSolicitante; }
private void ObtenerInfoPrestamo(int pIdPrestamo) { foreach (DataRow prestamo in _prestamos.Rows) { if (int.Parse(prestamo["ID_PRESTAMO"].ToString()) == pIdPrestamo) { String nombre = ""; // Descomentar esta línea para realizar pruebas en ambiente de desarrollo // ---------------------------------------------------------------------- // nombre = "Mauricio Muñoz Chaves"; // ---------------------------------------------------------------------- // Comentar estas líneas para realizar pruebas en ambiente de desarrollo // --------------------------------------------------------------------- wsSeguridad.SeguridadSoapClient wsseg = new wsSeguridad.SeguridadSoapClient(); wsseg.ComprobarEstudiante(out nombre, prestamo["CAR_USUARIOGIMNASIO"].ToString()); if (nombre == "") { wsseg.ComprobarUsuarioAD(out nombre, prestamo["CAR_USUARIOGIMNASIO"].ToString()); if (nombre == "") { nombre = "Nombre desconocido"; } } // --------------------------------------------------------------------- Label lblIdentifiacion = (Label)_prestamoElegido.FindControl("lblIdentificacion"); lblIdentifiacion.Text = prestamo["CAR_USUARIOGIMNASIO"].ToString(); Label lblNombre = (Label)_prestamoElegido.FindControl("lblNombre"); lblNombre.Text = nombre; Label lblFechaPrestamo = (Label)_prestamoElegido.FindControl("lblFechaPrestamo"); lblFechaPrestamo.Text = prestamo["FEC_PRESTAMO"].ToString(); String tipo = (prestamo["FK_IDTIPOPRESTAMO"].ToString() == "1") ? "Normal" : "Especial"; Label lblTipoPrestamo = (Label)_prestamoElegido.FindControl("lblTipoPrestamo"); lblTipoPrestamo.Text = tipo; Label lblEstadoPrestamo = (Label)_prestamoElegido.FindControl("lblEstadoPrestamo"); lblEstadoPrestamo.Text = prestamo["ESTADO"].ToString(); break; } } }