Esempio n. 1
0
        public async Task <ResultObj <SysModuleEntity> > GetMenuByRoleId(List <int> roleIdList)
        {
            ResultObj <SysModuleEntity> reObj = new ResultObj <SysModuleEntity>();

            if (!roleIdList.Contains(1))
            {
                DapperHelper <FaRoleModuleEntityView> roleModule = new DapperHelper <FaRoleModuleEntityView>();
                var allModel = await roleModule.FindAll(string.Format("c.is_hide=0 and a.role_id in ({0})", string.Join(",", roleIdList)));

                var tmpList = Fun.ClassListToCopy <FaRoleModuleEntityView, SysModuleEntity>(allModel.ToList());
                reObj.dataList = GetChildItems(tmpList, 0);
            }
            else
            {
                reObj.dataList = GetChildItems(await new DapperHelper <SysModuleEntity>().FindAll(i => i.isHide == 0), 0);
            }
            return(reObj);
        }