Example #1
0
        public async Task <MSSResult <int> > GetByID(int id)
        {
            MSSResult <int> mRet = new MSSResult <int>();

            try
            {
                if (id == 0)
                {
                    mRet.code = (int)ErrType.ErrParm;
                    mRet.msg  = "参数不正确,id不可为0";
                    return(mRet);
                }
                mRet.relatedData = await _RoleRepo.GetByID(id);

                //List<ActionAll> laa = await _ActionRepo.GetActionAll();
                //List<int> actions = await _ActionRepo.GetActionIDByRoleID(id);
                //mRet.data = ActionHelper.GetCheckedActionTree(laa, actions);
                mRet.data = (await _ActionRepo.GetActionIDByRoleID(id)).ToList();
                mRet.code = (int)ErrType.OK;
                return(mRet);
            }
            catch (Exception ex)
            {
                mRet.code = (int)ErrType.SystemErr;
                mRet.msg  = ex.Message;
                return(mRet);
            }
        }