/// <summary> /// Get all module accessright /// </summary> /// <param name="allowAccessActionList"></param> /// <returns></returns> private List <ModuleRightModel> GetAllModule(List <string> allowAccessActionList) { ModuleDA moduleDA = null; AccessRightDA accessRightDA = null; List <ModuleRightModel> moduleRightList = new List <ModuleRightModel>(); DataTable dtAllModule = new DataTable(); try { moduleDA = new ModuleDA(); accessRightDA = new AccessRightDA(); dtAllModule = moduleDA.GetAllLevel1Module(); 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"])) { mrModel.SubModule = GetSubModule(moduleDA, accessRightDA, allowAccessActionList, mrModel.ModuleCode, 1); } moduleRightList.Add(mrModel); } } } finally { if (accessRightDA != null) { accessRightDA.CloseConnection(); } if (moduleDA != null) { moduleDA.CloseConnection(); } } return(moduleRightList); }