Пример #1
0
 protected void button10_Click(object sender, EventArgs e)
 {
     ServiceReference1.WebServiceProyectoSoapClient referencia = new ServiceReference1.WebServiceProyectoSoapClient();
     if (txtNick.Text.Length != 0 && txtpass.Text.Length != 0 && txtcorreo.Text.Length != 0)
     {
         if (txtNick.Text.CompareTo(TextBox1.Text) == 0)
         {
             referencia.ModificarUsuarios(txtNick.Text, txtpass.Text, txtpass.Text);
             this.Label1.Visible = this.TextBox1.Visible = this.Button9.Visible = this.button10.Visible = this.Label2.Visible = this.Label3.Visible = this.Label4.Visible = txtcorreo.Visible = txtNick.Visible = txtpass.Visible = false;
             TextBox1.Enabled    = true;
             TextBox1.Text       = txtpass.Text = txtNick.Text = txtcorreo.Text = "";
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Usuario Modificado con exito');", true);
         }
         else
         {
             if (referencia.ModificarNicknameUsuarios(TextBox1.Text, txtNick.Text, txtpass.Text, txtcorreo.Text))
             {
                 this.Label1.Visible = this.TextBox1.Visible = this.Button9.Visible = this.button10.Visible = this.Label2.Visible = this.Label3.Visible = this.Label4.Visible = txtcorreo.Visible = txtNick.Visible = txtpass.Visible = false;
                 TextBox1.Enabled    = true;
                 TextBox1.Text       = txtpass.Text = txtNick.Text = txtcorreo.Text = "";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Usuario Modificado con exito');", true);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('El nombre de usuario ya existe');", true);
             }
         }
     }
 }