role.aspx.cs

来自「很不错的学生管理系统」· CS 代码 · 共 61 行

CS
61
字号
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_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 DataTable dt;
    private DataSet ds; 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ds = rl.select_popedom();
            if (ds != null)
            {
                this.grvpopedom.DataSource = ds.Tables[0];
                this.grvpopedom.DataBind();
            }
            else
            {
                this.grvpopedom.DataSource = null;
                this.grvpopedom.DataBind();
            }   
        }
    }
    protected void btn_refer_Click(object sender, EventArgs e)
    {
        if (this.HdnSelectedValues.Value != "")
        {
            roatt.names = this.txt_role.Text;
            string choose = this.HdnSelectedValues.Value;
            string[] chooess = choose.Split(',');
            int i = rl.new_role(roatt, chooess);
            if (i == 1)
            {
                Response.Write("<script language=javascript>window.alert('添加成功');</script>"); 
            }
            else
            {
                Response.Write("<script language=javascript>window.alert('添加失败');</script>"); 
            }
        }
        else
        {
            Response.Write("<script language=javascript>window.alert('请选择角色权限');</script>");    
        }
    }
   
   
}

⌨️ 快捷键说明

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