コード例 #1
0
        private void SaveRoleSpecialPermissions()
        {
            this.m_inputSpecialAll  = ((CheckBox)this.EgvSpecial.Rows[0].FindControl("ChkSpecialInput")).Checked;
            this.m_manageSpecialAll = ((CheckBox)this.EgvSpecial.Rows[0].FindControl("ChkSpecialManage")).Checked;
            int num = 0;

            foreach (GridViewRow row in this.EgvSpecial.Rows)
            {
                CheckBox    box   = (CheckBox)row.FindControl("ChkSpecialInput");
                CheckBox    box2  = (CheckBox)row.FindControl("ChkSpecialManage");
                HiddenField field = (HiddenField)row.FindControl("HdnSpecialId");
                if ((box.Checked && (field.Value != "0")) || (this.m_inputSpecialAll && (field.Value != "0")))
                {
                    StringHelper.AppendString(this.m_inputSpecialIds, field.Value);
                }
                if ((box2.Checked && (field.Value != "0")) || (this.m_manageSpecialAll && (field.Value != "0")))
                {
                    StringHelper.AppendString(this.m_manageSpecialIds, field.Value);
                }
                if (field.Value != "0")
                {
                    num++;
                }
            }
            AppendAllId(this.m_inputSpecialIds, num - 1);
            AppendAllId(this.m_manageSpecialIds, num - 1);
            RolePermissions.DeleteSpecialPermissionFromRoles(this.m_RoleId);
            RolePermissions.AddSepcialPermissionToRoles(this.m_RoleId, this.m_inputSpecialIds.ToString(), OperateCode.SpecialContentInput);
            RolePermissions.AddSepcialPermissionToRoles(this.m_RoleId, this.m_manageSpecialIds.ToString(), OperateCode.SepcialContentManage);
        }
コード例 #2
0
        private void InputRolePermission(int specialsId)
        {
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();

            for (int i = 0; i < this.EgvRoleView.Rows.Count; i++)
            {
                CheckBox box      = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkSpecialInput");
                CheckBox box2     = (CheckBox)this.EgvRoleView.Rows[i].FindControl("ChkSpecialManage");
                string   selectId = this.EgvRoleView.DataKeys[i].Value.ToString();
                AppendSelectId(box.Checked, roleIdList, selectId);
                AppendSelectId(box2.Checked, builder2, selectId);
            }
            RolePermissions.DeleteSpecialPermissionFromRoles(-1, specialsId);
            RolePermissions.AddSepcialPermissionToRoles(roleIdList.ToString(), specialsId, OperateCode.SpecialContentInput);
            RolePermissions.AddSepcialPermissionToRoles(builder2.ToString(), specialsId, OperateCode.SepcialContentManage);
        }