コード例 #1
0
        //保存权限消息
        protected void btnSaveRoleJuridiction_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dvEditList.Rows.Count; i++)
            {
                string   ID           = "";
                string   PowerString  = "";
                string   Activate     = "";
                Label    lblID        = (Label)dvEditList.Rows[i].FindControl("lblID");
                CheckBox cboxAdd      = (CheckBox)dvEditList.Rows[i].FindControl("cbAdd");
                CheckBox cboxDelete   = (CheckBox)dvEditList.Rows[i].FindControl("cbDelete");
                CheckBox cboxEdit     = (CheckBox)dvEditList.Rows[i].FindControl("cbEdit");
                CheckBox cboxSelect   = (CheckBox)dvEditList.Rows[i].FindControl("cbSelect");
                CheckBox cboxExport   = (CheckBox)dvEditList.Rows[i].FindControl("cbExport");
                CheckBox cboxPrint    = (CheckBox)dvEditList.Rows[i].FindControl("cbPrint");
                CheckBox cboxActivate = (CheckBox)dvEditList.Rows[i].FindControl("cbActivate");

                ID           = lblID.Text;
                PowerString += cboxAdd.Checked == true ? "1" : "0";
                PowerString += cboxDelete.Checked == true ? "1" : "0";
                PowerString += cboxEdit.Checked == true ? "1" : "0";
                PowerString += cboxSelect.Checked == true ? "1" : "0";
                PowerString += cboxExport.Checked == true ? "1" : "0";
                PowerString += cboxPrint.Checked == true ? "1" : "0";
                Activate     = cboxActivate.Checked == true ? "是" : "否";

                RolesJurisdictionBLL.UpdateRoleJurisdiction(ID, PowerString, Activate);
            }
            btnSearch_Click(sender, e); //重新加载查询
        }
コード例 #2
0
        //获得用户详细权限列表,用于修改
        public void getRolesDetailList(string strRole)
        {
            try
            {
                DataTable dt = RolesJurisdictionBLL.GetRolesJurisdictionDetailList(strRole);

                dvEditList.DataSource = dt;
                dvEditList.DataBind();
            }
            catch (Exception exc)
            {
                //异常处理
            }
        }
コード例 #3
0
        //获得用户列表
        public void getRolesList(string strRole)
        {
            try
            {
                DataTable dt = RolesJurisdictionBLL.GetRolesJurisdictionList(strRole);
                //dvList.DataSource = dt;
                //dvList.DataBind();

                //rptRolesJurisdiction

                PagedDataSource pds = new PagedDataSource();
                pds.DataSource                  = dt.DefaultView;
                pds.AllowPaging                 = true;
                pds.PageSize                    = this.anpList.PageSize;
                pds.CurrentPageIndex            = this.anpList.CurrentPageIndex - 1;
                this.anpList.RecordCount        = dt.Rows.Count;
                rptRolesJurisdiction.DataSource = pds;
                rptRolesJurisdiction.DataBind();
            }
            catch (Exception exc)
            {
                //异常处理
            }
        }