Example #1
0
 protected void Button9_Click(object sender, EventArgs e)
 {
     ServiceReference1.WebServiceProyectoSoapClient referencia = new ServiceReference1.WebServiceProyectoSoapClient();
     if (this.TextBox1.Text.Length != 0)
     {
         if (!referencia.BuscarUsuario(this.TextBox1.Text))
         {
             this.TextBox1.Enabled = false;
             string datosusuario = referencia.Devolverusuario(this.TextBox1.Text);
             if (datosusuario.CompareTo("") != 0)
             {
                 string[] datos = datosusuario.Split(',');
                 txtNick.Text          = datos[0];
                 txtpass.Text          = datos[1];
                 txtcorreo.Text        = datos[2];
                 this.button10.Visible = this.Label2.Visible = this.Label3.Visible = this.Label4.Visible = txtcorreo.Visible = txtNick.Visible = txtpass.Visible = true;
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('El usuario no existe');", true);
             this.TextBox1.Enabled = true;
         }
     }
 }
Example #2
0
 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
 {
     if (Login1.UserName == "admin" && Login1.Password == "1234")
     {
         e.Authenticated   = true;
         Session["Nombre"] = "admin";
         Response.Redirect("Inicio.aspx");
     }
     else
     {
         if (sr.BuscarUsuario(Login1.UserName))
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('El usuario no existe');", true);
             e.Authenticated = false;
         }
         else
         {
             e.Authenticated   = true;
             Session["Nombre"] = Login1.UserName;
             Response.Redirect("Inicio.aspx");
         }
     }
 }