⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 powerlist.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Collections.Generic;

namespace YXShop.Web.Admin.XML
{
    public partial class PowerList : System.Web.UI.Page
    {
        public static int RoleID = 0;
        YXShop.BLL.Roles_Permissions bll = new YXShop.BLL.Roles_Permissions();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AdminID"] == null)
            {
                Response.Redirect("../index.aspx", true);
            }
            else
            {
                if (string.IsNullOrEmpty(Session["AdminID"].ToString()))
                {
                    Response.Redirect("../index.aspx", true);
                }
            }
            if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                //初始化信息(订单信息,银行信息,支付信息)
                if (YXShop.Common.WebUtility.isNumeric(Request.QueryString["RoleID"]))
                {
                    RoleID = int.Parse(Request.QueryString["RoleID"]);
                }
                else
                {
                    Response.Redirect("../index.aspx");
                }
            }
        }

        private void AddPowers(int RoleID)
        {
            List<YXShop.Model.Roles_Permissions> list = new List<YXShop.Model.Roles_Permissions>();
            YXShop.Model.Roles_Permissions rModel = null;
            foreach (TreeNode tNode in TreeView1.CheckedNodes)
            {
                rModel = new YXShop.Model.Roles_Permissions();
                rModel.RoleID = RoleID;
                if (YXShop.Common.WebUtility.isNumeric(tNode.Value))
                {
                    rModel.OperateCode = int.Parse(tNode.Value);
                }
                else 
                {
                    continue;
                }
                list.Add(rModel);
                rModel = null;
            }
            bll.Add(list);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            AddPowers(RoleID);
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -