コード例 #1
0
        private void parseChildTreeData(Hashtable pHash, SMC_Functions parent_fncs, SMC_FunctionRoleDao frDao)
        {
            IList <SMC_Functions> funcs = SMC_FunctionsDao.QueryFunctionsByUpperFNIDForSystemManager(parent_fncs.FN_ID);

            if (funcs != null && funcs.Count > 0)
            {
                List <Hashtable> objs = new List <Hashtable>();
                foreach (SMC_Functions fn in funcs)
                {
                    Hashtable hash = new Hashtable();
                    hash["id"]   = fn.FN_ID;
                    hash["name"] = fn.FN_Name;
                    //hash["url"] = "/AuthManage/FunctionList?upper_fn_id=" + fn.FN_ID;

                    if (SMC_FunctionsDao.HasChild(fn.FN_ID))
                    {
                        hash["url"]    = "/AuthManage/FunctionList?upper_fn_id=" + fn.FN_ID;
                        hash["target"] = "ifrm";
                    }
                    else
                    {   //叶节点
                        hash["url"]    = "/AuthManage/AddModifyFunction?upper_fn_id=" + parent_fncs.FN_ID + "&FN_ID=" + fn.FN_ID;
                        hash["target"] = "_top";
                    }
                    parseChildTreeData(hash, fn, frDao);
                    objs.Add(hash);
                }
                if (objs.Count > 0)
                {
                    pHash["children"] = objs;
                }
            }
        }
コード例 #2
0
        private void parseChildTreeData(Hashtable pHash, SMC_Functions parent_fncs, SMC_FunctionRoleDao frDao, int RoleId)
        {
            IList <SMC_Functions> funcs = SMC_FunctionsDao.QueryFunctionsByUpperFNIDForUnitManager(parent_fncs.FN_ID);

            if (funcs != null && funcs.Count > 0)
            {
                List <Hashtable> objs = new List <Hashtable>();
                foreach (SMC_Functions fn in funcs)
                {
                    Hashtable hash = new Hashtable();
                    hash["id"]      = fn.FN_ID;
                    hash["name"]    = fn.FN_Name;
                    hash["checked"] = frDao.IsFunctionInRole(fn.FN_ID, RoleId);
                    parseChildTreeData(hash, fn, frDao, RoleId);
                    objs.Add(hash);
                }
                if (objs.Count > 0)
                {
                    pHash["children"] = objs;
                }
            }
        }
コード例 #3
0
        public virtual Hashtable QueryFunctionsTreeDataByUpperFNID(int UpperFNID)
        {
            try
            {
                SMC_FunctionRoleDao   frDao = new SMC_FunctionRoleDao(AppConfig.statisticDBKey);
                IList <SMC_Functions> funcs = SMC_FunctionsDao.QueryFunctionsByUpperFNIDForSystemManager(0);
                Hashtable             phash = new Hashtable();
                phash["id"]      = 0;
                phash["name"]    = "权限";
                phash["url"]     = "/AuthManage/FunctionList?upper_fn_id=0";
                phash["target"]  = "ifrm";
                phash["open"]    = true;
                phash["checked"] = false;
                List <Hashtable> objs = new List <Hashtable>();
                if (funcs != null && funcs.Count > 0)
                {
                    foreach (SMC_Functions fn in funcs)
                    {
                        Hashtable hash = new Hashtable();

                        hash["id"]     = fn.FN_ID;
                        hash["name"]   = fn.FN_Name;
                        hash["url"]    = "/AuthManage/FunctionList?upper_fn_id=" + fn.FN_ID;
                        hash["target"] = "ifrm";
                        hash["open"]   = true;
                        parseChildTreeData(hash, fn, frDao);
                        objs.Add(hash);
                    }
                }
                phash["children"] = objs;
                return(phash);
            }
            catch (DalException ex)
            {
                throw new BOException("QueryFunctionsByUnitID", ex);
            }
        }
コード例 #4
0
        public virtual Hashtable QueryFunctionsTreeDataByUnit(string Unit_ID, int Role_ID)
        {
            try
            {
                SMC_FunctionRoleDao frDao = new SMC_FunctionRoleDao(AppConfig.statisticDBKey);

                IList <SMC_Functions> funcs = SMC_FunctionsDao.QueryFunctionsByUpperFNIDForUnitManager(0);//SMC_FunctionsDao.QueryFunctionsByUnitID(Unit_ID, 0);
                Hashtable             phash = new Hashtable();
                phash["id"]      = 0;
                phash["name"]    = "请选择权限";
                phash["open"]    = true;
                phash["checked"] = false;
                List <Hashtable> objs = new List <Hashtable>();
                if (funcs != null && funcs.Count > 0)
                {
                    foreach (SMC_Functions fn in funcs)
                    {
                        Hashtable hash = new Hashtable();

                        bool isFnInRole = frDao.IsFunctionInRole(fn.FN_ID, Role_ID);
                        hash["id"]      = fn.FN_ID;
                        hash["name"]    = fn.FN_Name;
                        hash["open"]    = true;
                        hash["checked"] = isFnInRole;
                        parseChildTreeData(hash, fn, frDao, Role_ID);
                        objs.Add(hash);
                    }
                }
                phash["children"] = objs;
                return(phash);
            }
            catch (DalException ex)
            {
                throw new BOException("QueryFunctionsByUnitID", ex);
            }
        }