示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AccessControl.IsAdmin(this))
        {
            Response.Redirect("Homepage.aspx");
        }

        if (Request["deleteUser"] != null)
        {
            DataLink.Delete(Request["deleteUser"].Trim().Replace("'", ""));
        }

        if (Request["setAdmin"] != null)
        {
            DataLink.SetAdmin(Request["setAdmin"].Trim().Replace("'", ""), true);
        }

        if (Request["unsetAdmin"] != null)
        {
            DataLink.SetAdmin(Request["unsetAdmin"].Trim().Replace("'", ""), false);
        }

        usersTable = ConstructTable(DataLink.GetUsers(searchString.Value.Replace("'", "")));
    }