TZ.Web/MyAdmin/Role/list.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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.Text;
using TZ.Common;
using TZ.Model;
using TZ.BLL;

public partial class MyAdmin_Role_list : System.Web.UI.Page
{
    protected int user_id;
    protected TZ.Model.UserInfo user;
    protected TZ.BLL.RoleInfo bll = new TZ.BLL.RoleInfo();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (int.TryParse(Utils.GetCookie("UserInfo"), out user_id))
        {
            if (user_id > 0)
            {
                user = new TZ.BLL.UserInfo().GetModel(user_id);//获得用户信息
            }
        }
        else
        {
            Response.Redirect("../Login.aspx");
        }
        if (!IsPostBack)
        {
            RptBind();
        }
    }
    protected void RptBind()
    {
        DataSet ds = bll.GetAllRole();
        this.rptList.DataSource = ds;
        this.rptList.DataBind();
    }
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        int sucCount = 0; //成功数量
        int errorCount = 0; //失败数量
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                if (id == 1)//禁止删除超级管理员组
                {
                    errorCount++;
                }
                else
后面还有 15 行代码,购买后查看完整代码

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

AI 解读

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

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