Exemple #1
0
        private void SaveUserFieldPermissions()
        {
            string        selectId   = "";
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            StringBuilder builder3   = new StringBuilder();

            this.m_NodeSkimAll    = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodeSkim")).Checked;
            this.m_NodePreviewAll = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodePreview")).Checked;
            this.m_NodeInputAll   = ((CheckBox)this.EgvNodes.Rows[0].FindControl("ChkNodeInput")).Checked;
            for (int i = 0; i < this.EgvNodes.Rows.Count; i++)
            {
                this.m_ChkNodeSkim    = (CheckBox)this.EgvNodes.Rows[i].Cells[2].FindControl("ChkNodeSkim");
                this.m_ChkNodePreview = (CheckBox)this.EgvNodes.Rows[i].Cells[3].FindControl("ChkNodePreview");
                this.m_ChkNodeInput   = (CheckBox)this.EgvNodes.Rows[i].Cells[4].FindControl("ChkNodeInput");
                selectId = this.EgvNodes.DataKeys[i].Value.ToString();
                AppendSelectId(this.m_ChkNodeSkim.Checked || this.m_NodeSkimAll, selectId, ref roleIdList);
                AppendSelectId(this.m_ChkNodePreview.Checked || this.m_NodePreviewAll, selectId, ref builder2);
                AppendSelectId(this.m_ChkNodeInput.Checked || this.m_NodeInputAll, selectId, ref builder3);
            }
            AppendAllId(roleIdList, this.EgvNodes.Rows.Count - 1);
            AppendAllId(builder2, this.EgvNodes.Rows.Count - 1);
            AppendAllId(builder3, this.EgvNodes.Rows.Count - 1);
            UserPermissions.DeleteNodePermissions(this.m_RoleId, this.m_IdType);
            UserPermissions.AddNodePermissions(this.m_RoleId, OperateCode.NodeContentSkim, roleIdList.ToString(), this.m_IdType);
            UserPermissions.AddNodePermissions(this.m_RoleId, OperateCode.NodeContentPreview, builder2.ToString(), this.m_IdType);
            UserPermissions.AddNodePermissions(this.m_RoleId, OperateCode.NodeContentInput, builder3.ToString(), this.m_IdType);
        }
 private void AddNodesPermission()
 {
     UserPermissions.DeleteNodePermissions(this.m_GroupId, this.IdType);
     if (!UserPermissions.AddNodePermissions(this.m_GroupId, OperateCode.NodeContentInput, this.m_inputNodeIdList.ToString(), this.IdType))
     {
         this.m_strMsg.Append("<li>节点录入权限添加失败!</li>");
     }
     if (!UserPermissions.AddNodePermissions(this.m_GroupId, OperateCode.NodeContentSkim, this.m_SkimNodeIdList.ToString(), this.IdType))
     {
         this.m_strMsg.Append("<li>节点录入审核添加失败!</li>");
     }
     if (!UserPermissions.AddNodePermissions(this.m_GroupId, OperateCode.NodeContentPreview, this.m_showNodeIdList.ToString(), this.IdType))
     {
         this.m_strMsg.Append("<li>节点操作管理修改失败!</li>");
     }
 }
        private void InputPermissions(int nodeId)
        {
            string        selectId   = "";
            StringBuilder roleIdList = new StringBuilder();
            StringBuilder builder2   = new StringBuilder();
            StringBuilder builder3   = new StringBuilder();

            for (int i = 0; i < this.EgvPermissions.Rows.Count; i++)
            {
                CheckBox box3 = (CheckBox)this.EgvPermissions.Rows[i].FindControl("ChkNodeSkim");
                CheckBox box  = (CheckBox)this.EgvPermissions.Rows[i].FindControl("ChkNodeShow");
                CheckBox box2 = (CheckBox)this.EgvPermissions.Rows[i].FindControl("ChkNodeInput");
                selectId = this.EgvPermissions.DataKeys[i].Value.ToString();
                AppendSelectId(box3.Checked, builder3, selectId);
                AppendSelectId(box.Checked, roleIdList, selectId);
                AppendSelectId(box2.Checked, builder2, selectId);
            }
            UserPermissions.AddNodePermissions(builder2.ToString(), OperateCode.NodeContentInput, nodeId, 1);
            UserPermissions.AddNodePermissions(roleIdList.ToString(), OperateCode.NodeContentPreview, nodeId, 1);
            UserPermissions.AddNodePermissions(builder3.ToString(), OperateCode.NodeContentSkim, nodeId, 1);
        }