Hl.WebMain/AdmPage/Sys/Perm/PostPerm.aspx.cs

(完整代码) 2KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Hl.Code;
using Hl.WebMain.Common;

namespace Hl.WebMain.AdmPage.Sys.Perm
{
    public partial class PostPerm : System.Web.UI.Page
    {
        #region "全局变量"

        public string SelectPath = "/Controls/JsControls/JsDataList.aspx?op=AdmMenuPost&admPostId=";//查询-路径

        #endregion

        #region "页面加载"

        protected void Page_Load(object sender, EventArgs e)
        {
            DataModel.AdmPost thisInfo = DataBll.AdmPost.Select(DataConvert.ToInt(Request.QueryString["id"], 0));
            if (thisInfo == null)
            {
                Message.MessageShows("", "参数错误!");
            }
            SelectPath += DataConvert.ToInt(Request.QueryString["id"], 0);
        }

        #endregion

        #region "相关操作"

        protected void Tool_OnClick(object sender, EventArgs e)
        {
            int postKeyId = DataConvert.ToInt(Request.QueryString["id"], 0);
            int menuCount = Request.Params.GetValues("submitMenu") == null ? 0 : Request.Params.GetValues("submitMenu").Length;
            //删除原先权限
            DataBll.AdmPermPost.DeleteBywhere("AdmPostId=" + postKeyId);
            //保存最新权限
            for (int i = 0; i < menuCount; i++)
            {
                DataModel.AdmPermPost m = new DataModel.AdmPermPost();
                m.AdmMenuId = DataConvert.ToInt(Request.Params.GetValues("submitMenu")[i], 0);
                m.AdmPostId = postKeyId;
                m.AdmOperKey = Request.Params.GetValues("submitOper" + m.AdmMenuId) == null ? "" : Request.Params.GetValues("submitOper" + m.AdmMenuId)[0];
                DataBll.AdmPermPost.Insert(m);
            }
            new Message("消息提示", "rihgt", "保存权限设置成功!", null, this.Page).MsgOpen(true, "", true);
        }

        #endregion
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。