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); } } }
protected void grivsecre_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("desact")) { if (cmdduser.userdesctivar(e.CommandArgument.ToString(), "router main")) { if (cmddactive.removeactive(e.CommandArgument.ToString(), "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); } } }