Beispiel #1
0
        /// <summary>
        /// get sub module accessright
        /// </summary>
        /// <param name="allowAccessActionList"></param>
        /// <param name="moduleCode"></param>
        /// <param name="deep"></param>
        /// <returns></returns>
        private List <ModuleRightModel> GetSubModule(ModuleDA moduleDA, AccessRightDA accessRightDA, List <string> allowAccessActionList, string moduleCode, int deep)
        {
            List <ModuleRightModel> moduleRightList = new List <ModuleRightModel>();

            DataTable dtAllModule = moduleDA.GetModuleByFatherCode(moduleCode);

            for (int i = 0; i < dtAllModule.Rows.Count; i++)
            {
                DataRow dr = dtAllModule.Rows[i];
                if (dr["code"] != null)
                {
                    ModuleRightModel mrModel = FillModuleRightModel(dr, allowAccessActionList, accessRightDA);

                    if (CommUtil.ConvertObjectToBool(dr["IsFatherNode"]) && deep <= 5)
                    {
                        mrModel.SubModule = GetSubModule(moduleDA, accessRightDA, allowAccessActionList, mrModel.ModuleCode, deep);
                    }
                    moduleRightList.Add(mrModel);
                }
            }
            return(moduleRightList);
        }