protected void btnSetPurview_Click(object sender, EventArgs e)
    {
        string   strPurview, strDeletePurview;
        CheckBox chkTemp = new CheckBox();

        strPurview       = "";
        strDeletePurview = "";
        foreach (TableRow trTemp in FindControl("tbPurviewInfo").Controls)
        {
            foreach (TableCell tcTemp in trTemp.Controls)
            {
                foreach (Object ctlTemp in tcTemp.Controls)
                {
                    if (ctlTemp.GetType().ToString() == typeof(CheckBox).ToString())
                    {
                        chkTemp = (CheckBox)ctlTemp;
                        if (chkTemp.Checked == true)
                        {
                            strPurview = strPurview + "," + chkTemp.ID.ToString();
                        }
                        else
                        {
                            strDeletePurview = strDeletePurview + "," + chkTemp.ID.ToString();
                        }
                    }
                }
            }
        }
        htInputParameter = new Hashtable();
        dsRecordInfo     = new DataSet();
        htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo);
        htInputParameter.Add(ConstantsManager.MESSAGE_ID, "");
        htInputParameter.Add("UserGroupID", lblUserGroupID.Text);
        htInputParameter.Add("UserGroupPurview", strPurview);
        htInputParameter.Add("UserGroupDeletePurview", strDeletePurview);
        UserGroupPurviewLibrary instanceUserGroupPurviewLibrary = new UserGroupPurviewLibrary();

        instanceUserGroupPurviewLibrary.SetUserGroupPurviewInfo(htInputParameter);

        //对成功消息进行处理
        strMessageParam[0] = "用户组权限";
        strMessageParam[1] = "修改";
        strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, strMessageParam, strMessageInfo);
        //MessageContent = strMessageInfo;
        Session[ConstantsManager.SESSION_REDIRECT_PAGE] = CURRENT_PATH + "/" + REDIRECT_PAGE;

        //记录日志开始
        string strLogTypeID = "A02";

        strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
        strMessageParam[1] = "用户组权限";
        strMessageParam[2] = lblUserGroupID.Text;
        strMessageParam[3] = "修改";
        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, strMessageParam);

        LogLibrary.LogWrite(strLogTypeID, strLogContent, (string)htInputParameter["ObjectID"], null, null);
        //记录日志结束

        //成功后页面跳转
        Response.Redirect(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/Administrator/A_BM/APMUserGroupList.aspx");
        Response.End();
    }
    private void InitialPage()
    {
        //定义权限类型名临时变量
        string strPurviewTypeName;
        int    intCount;
        int    i;

        htInputParameter = new Hashtable();
        dsRecordInfo     = new DataSet();
        htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo);
        htInputParameter.Add(ConstantsManager.MESSAGE_ID, "");
        htInputParameter.Add("UserGroupID", lblUserGroupID.Text);

        UserGroupLibrary instanceUserGroupLibrary = new UserGroupLibrary();

        htOutputParameter = instanceUserGroupLibrary.SelectRecordInfo(htInputParameter);
        dsRecordInfo      = (DataSet)htOutputParameter[ConstantsManager.QUERY_DATASET_NAME];

        lblUserGroupName.Text    = dsRecordInfo.Tables[0].Rows[0]["UserGroupName"].ToString();
        lblUserGroupID.Text      = dsRecordInfo.Tables[0].Rows[0]["UserGroupID"].ToString();
        lblUserGroupContent.Text = dsRecordInfo.Tables[0].Rows[0]["UserGroupContent"].ToString();

        htInputParameter = new Hashtable();
        dsRecordInfo     = new DataSet();
        htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo);
        htInputParameter.Add(ConstantsManager.MESSAGE_ID, "");
        htInputParameter.Add("UserGroupID", lblUserGroupID.Text);
        htInputParameter.Add("PurviewPRI", int.Parse(rblPurviewPRI.SelectedValue));
        UserGroupPurviewLibrary instanceUserGroupPurviewLibrary = new UserGroupPurviewLibrary();

        htOutputParameter  = instanceUserGroupPurviewLibrary.GetUserGroupPurviewInfo(htInputParameter);
        dsRecordInfo       = (DataSet)htOutputParameter[ConstantsManager.QUERY_DATASET_NAME];
        strPurviewTypeName = "";
        for (i = 0; i < dsRecordInfo.Tables[0].Rows.Count; i++)
        {
            TableRow trTemp = new TableRow();
            intCount = i;
            for (int j = i; j < intCount + 4 && j < dsRecordInfo.Tables[0].Rows.Count; j++)
            {
                i = j;
                if (dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString() != strPurviewTypeName)
                {
                    TableRow  trTempTitle = new TableRow();
                    TableCell tcTempTitle = new TableCell();
                    Label     lblTemp     = new Label();
                    lblTemp.Text = dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString();
                    tcTempTitle.Controls.Add(lblTemp);
                    tcTempTitle.ColumnSpan = 4;
                    tcTempTitle.CssClass   = "xingmu";
                    trTempTitle.Cells.Add(tcTempTitle);
                    tbPurviewInfo.Rows.Add(trTemp);
                    tbPurviewInfo.Rows.Add(trTempTitle);
                    strPurviewTypeName = dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString();
                    trTemp             = new TableRow();
                }
                TableCell tcTemp  = new TableCell();
                CheckBox  chkTemp = new CheckBox();
                chkTemp.ID   = dsRecordInfo.Tables[0].Rows[i]["PurviewID"].ToString();
                chkTemp.Text = dsRecordInfo.Tables[0].Rows[i]["PurviewName"].ToString();
                if (DataValidateManager.ValidateIsNull(dsRecordInfo.Tables[0].Rows[i]["IsPageMenu"]) == false)
                {
                    if ((bool)dsRecordInfo.Tables[0].Rows[i]["IsPageMenu"] == true)
                    {
                        chkTemp.Text = chkTemp.Text + "(菜单项)";
                    }
                }
                chkTemp.InputAttributes.Add("value", dsRecordInfo.Tables[0].Rows[i]["PurviewID"].ToString());
                if (dsRecordInfo.Tables[0].Rows[i]["UserGroupID"] == DBNull.Value ||
                    dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() == "" ||
                    dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() == string.Empty)
                {
                    chkTemp.Checked = false;
                }
                else if (dsRecordInfo.Tables[0].Rows[i]["UserGroupID"] != DBNull.Value &&
                         dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() != "" &&
                         dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() != string.Empty)
                {
                    chkTemp.Checked = true;
                }
                tcTemp.Controls.Add(chkTemp);
                tcTemp.CssClass = "hback";
                trTemp.Cells.Add(tcTemp);
            }
            tbPurviewInfo.Rows.Add(trTemp);
        }
    }