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

📄 modify_role.aspx.cs

📁 很不错的学生管理系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using es_business = com.egt.business;

public partial class popedom_modify_role : System.Web.UI.Page
{
    private es_business.role rl = new com.egt.business.role();
    private es_business.RoleAttribute roatt = new com.egt.business.RoleAttribute();
    private DataSet ds;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ds = rl.select_role();
            if (ds != null)
            {
                this.drop_role.DataTextField = ds.Tables[0].Columns["names"].ColumnName;
                this.drop_role.DataValueField = ds.Tables[0].Columns["id"].ColumnName;
                this.drop_role.DataSource = ds;
                this.drop_role.DataBind();
            }
            else
            {
                this.drop_role.Items.Clear();
            }
            ds = rl.select_popedom();
            if (ds != null)
            {
                this.select_popedomnone();
            }
            else
            {
                this.grv_popedom.DataSource = null;
                this.grv_popedom.DataBind();
            }
            

        }
    }
    protected void btn_modify_Click(object sender, EventArgs e)
    {
        string middle = this.HdnSelectedValues.Value;
        string[] dt = middle.Split(',');
        roatt.id = Convert.ToInt32(this.drop_role.SelectedValue);
        int i = rl.update_role(roatt, dt,"增加");
        if (i == 1)
        {
            Response.Write("<script language=javascript>window.alert('修改成功');</script>");    
        }
        else
        {
            Response.Write("<script language=javascript>window.alert('修改失败');</script>");   
        }
    }
    protected void btn_end_Click(object sender, EventArgs e)
    {
        string middle = this.HdnSelectedValues.Value;
        string[] dt = middle.Split(',');
        roatt.id = Convert.ToInt32(this.drop_role.SelectedValue);
        int i = rl.update_role(roatt, dt, "删除");
        if (i == 1)
        {
            Response.Write("<script language=javascript>window.alert('修改成功');</script>");   
        }
        else
        {
            Response.Write("<script language=javascript>window.alert('修改失败');</script>");   
        }
    }
    protected void drop_role_SelectedIndexChanged(object sender, EventArgs e)
    {
        select_popedomnone();
    }

    /// <summary>
    /// 绑定权限列表
    /// </summary>
    public void select_popedomnone()
    {
        ds = rl.select_popedomnone(this.drop_role.SelectedValue);
        if (ds != null)
        {
            this.grv_popedom.DataSource = ds;
            this.grv_popedom.DataBind();
        }
        else
        {
            this.grv_popedom.DataSource = null;
            this.grv_popedom.DataBind();
        }
    }
}

⌨️ 快捷键说明

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