Ejemplo n.º 1
0
 protected void repetidorservices_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName.Equals("cortar"))
     {
         secrest         sec     = new secrest();
         activeconection acticon = new activeconection();
         sec = sec.consultarsecretsbyip("router main", e.CommandArgument.ToString());
         if (sec.userdesctivar(sec.name, "router main"))
         {
             if (acticon.removeactive(sec.name, "router main"))
             {
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('bien!', 'Fallo en registar la operacion', 'success');", true);
             }
             ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('bien!', 'Fallo en registar la operacion', 'success');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('ERROR!', 'Fallo en registar la operacion', 'error');", true);
         }
     }
     if (e.CommandName.Equals("activar"))
     {
         secrest         sec     = new secrest();
         activeconection acticon = new activeconection();
         sec = sec.consultarsecretsbyip("router main", e.CommandArgument.ToString());
         if (sec.useractivar(sec.name, "router main"))
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('bien!', 'Fallo en registar la operacion', 'success');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "swal('ERROR!', 'Fallo en registar la operacion', 'error');", true);
         }
     }
 }