コード例 #1
0
ファイル: PageWriting.cs プロジェクト: RealR3D/UserCenter
        public void Page_Load(object sender, EventArgs e)
        {
            if (!Main.Instance.AdminApi.IsPluginAuthorized)
            {
                HttpContext.Current.Response.Write("<h1>未授权访问</h1>");
                HttpContext.Current.Response.End();
                return;
            }

            _configInfo = Utils.GetConfigInfo();

            if (!string.IsNullOrEmpty(Request.QueryString["delete"]) &&
                !string.IsNullOrEmpty(Request.QueryString["groupId"]))
            {
                GroupDao.Delete(Convert.ToInt32(Request.QueryString["groupId"]));
                LtlMessage.Text = Utils.GetMessageHtml("删除成功!", true);
            }

            if (IsPostBack)
            {
                return;
            }

            var groupInfoList = GroupDao.GetGroupInfoList();

            groupInfoList.Insert(0, Utils.GetDefaultGroupInfo(_configInfo));
            RptContents.DataSource     = groupInfoList;
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();

            BtnAdd.OnClientClick = $"location.href = '{PageWritingSettings.GetAddUrl()}';return false;";
        }