// Methods
        protected void BindContent()
        {
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                try
                {
                    SysNo = int.Parse(Request.QueryString["id"]);

                    DataTable             m_pri = REL_Admin_PrivilegeBll.GetInstance().GetListByAdmin(SysNo);
                    Dictionary <int, int> tmp   = new Dictionary <int, int>();
                    for (int i = 0; i < m_pri.Rows.Count; i++)
                    {
                        tmp.Add(int.Parse(m_pri.Rows[i]["Privilege_SysNo"].ToString()), int.Parse(m_pri.Rows[i]["SysNo"].ToString()));
                    }
                    ViewState["privilege"] = tmp;
                }
                catch
                {
                    Response.Redirect("../Error.aspx?msg=");
                    return;
                }
            }
            DataTable m_dt = SYS_PrivilegeBll.GetInstance().GetList();

            this.rptFamous.DataSource = m_dt;
            this.rptFamous.DataBind();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Login(base.Request.RawUrl);
            base.CheckPrivilege(base.Request.RawUrl);
            WebForAdmin.Master.AdminMaster m_master = (WebForAdmin.Master.AdminMaster)base.Master;
            m_master.PageName = "后台管理员管理";
            m_master.SetCate(WebForAdmin.Master.AdminMaster.CateType.Privilege1);
            if (!base.IsPostBack)
            {
                if ((base.Request.QueryString["delete"] != null) && (base.Request.QueryString["delete"] != ""))
                {
                    this.Delete();
                }
                if ((base.Request.QueryString["pn"] != null) && (base.Request.QueryString["pn"] != ""))
                {
                    try
                    {
                        this.pageindex = int.Parse(base.Request.QueryString["pn"]);
                    }
                    catch
                    {
                    }
                }

                #region 绑定选项
                drpPrivilege.DataSource     = SYS_PrivilegeBll.GetInstance().GetList();
                drpPrivilege.DataTextField  = "name";
                drpPrivilege.DataValueField = "sysno";
                drpPrivilege.DataBind();
                drpPrivilege.Items.Insert(0, new ListItem("请选择", "0"));
                #endregion

                this.urlnow = this.urlnow + "?pn=" + this.pageindex;
                if ((base.Request.QueryString["name"] != null) && (base.Request.QueryString["name"] != ""))
                {
                    this.txtName.Text = base.Request.QueryString["name"];
                    this.urlnow       = this.urlnow + "&name=" + base.Request.QueryString["name"];
                }
                if ((base.Request.QueryString["privilege"] != null) && (base.Request.QueryString["privilege"] != ""))
                {
                    this.drpPrivilege.SelectedIndex = this.drpPrivilege.Items.IndexOf(this.drpPrivilege.Items.FindByValue(base.Request.QueryString["privilege"]));
                    this.urlnow = this.urlnow + "&privilege=" + base.Request.QueryString["privilege"];
                }
                if ((base.Request.QueryString["status"] != null) && (base.Request.QueryString["status"] != ""))
                {
                    this.drpStatus.SelectedIndex = this.drpStatus.Items.IndexOf(this.drpStatus.Items.FindByValue(base.Request.QueryString["status"]));
                    this.urlnow = this.urlnow + "&status=" + base.Request.QueryString["status"];
                }



                this.BindContent();
            }
        }
Example #3
0
 private void SetPrivilege(int adminsysno)
 {
     try
     {
         int user = int.Parse(drpPrivilege.SelectedValue);
         if (user == 0)
         {
             return;
         }
         SYS_PrivilegeBll.GetInstance().CopyPrivilege(user, adminsysno);
     }
     catch
     {
         return;
     }
 }