Example #1
0
 private void InitFunctionNode(TreeNodeExt parentNode,DataTable dt)
 {
     foreach (DataRow row in dt.Select("PARENTFUNCID = '"+parentNode.Value+"'", "FUNCID ASC"))
     {
         TreeNodeExt node = null;
         if (row["ROLEFUNCTION"].ToString().Equals(MES_Misc.Y.ToString()))
         {
             node = new TreeNodeExt(row["FUNCDESC"].ToString(), row["FUNCID"].ToString(), true);
         }
         else
         {
             node = new TreeNodeExt(row["FUNCDESC"].ToString(), row["FUNCID"].ToString(), false);
         }
         InitFunctionNode(node,dt);
         parentNode.Nodes.Add(node);
     }
 }
Example #2
0
 private void InitFunctionTree()
 {
     DataTable dt = null;
     if (UpdateMode == Public_UpdateMode.Update)
     {
         dt = GetRoleFunctionByRoleId(RoleId).Tables[0];
     }
     else
     {
         dt = GetRoleFunction().Tables[0];
     }
     foreach (DataRow row in dt.Select("PARENTFUNCID is null", "FUNCID ASC"))
     {
         TreeNodeExt node = null;
         if (row["ROLEFUNCTION"].ToString().Equals(MES_Misc.Y.ToString()))
         {
             node = new TreeNodeExt(row["FUNCDESC"].ToString(), row["FUNCID"].ToString(), true);
         }
         else
         {
             node = new TreeNodeExt(row["FUNCDESC"].ToString(), row["FUNCID"].ToString(), false);
         }
         InitFunctionNode(node, dt);
         this.treeFunction.Nodes.Add(node);
     }
 }
Example #3
0
 private void GetRoleFunctionsNode(List<tsecrolefunction> list, TreeNodeExt parentNode, string _roleId)
 {
     foreach (TreeNodeExt node in parentNode.Nodes)
     {
         if (node.Checked)
         {
             tsecrolefunction rolefunction = new tsecrolefunction();
             rolefunction.roleid = _roleId;
             rolefunction.funcid = node.Value.ToString();
             rolefunction.permis = "Allow";
             rolefunction.createduser = GENLSYS.MES.Common.Function.GetCurrentUser();
             rolefunction.createdtime = GENLSYS.MES.Common.Function.GetCurrentTime();
             rolefunction.lastmodifieduser = GENLSYS.MES.Common.Function.GetCurrentUser();
             rolefunction.lastmodifiedtime = GENLSYS.MES.Common.Function.GetCurrentTime();
             list.Add(rolefunction);
         }
         GetRoleFunctionsNode(list,node,_roleId);
     }
 }