Beispiel #1
0
        public async Task <ActionResult> SetRole(long apartId, string roleIds)
        {
            var result = new JsonModel();
            await UserRole2ApartRepository.SaveListAsync(apartId, roleIds);

            result.message = "保存成功!";
            return(Json(result));
        }
Beispiel #2
0
        public async Task <ActionResult> SetRole(long apartId)
        {
            var model = new SetRoleModel()
            {
                UserId             = apartId,
                SelectedRoleIdList = await UserRole2ApartRepository.GetRoleIdListAsync(apartId),
                UserRoleList       = await UserRoleRepository.GetListAsync()
            };

            return(PartialView(model));
        }
        public ActionResult GetApart(long id)
        {
            var result = new JsonModel();
            var apart  = SysApartRepository.Get(id);

            if (apart == null)
            {
                result.msg = "找不到记录!";
                return(Json(result));
            }
            apart.LstRoleIds = UserRole2ApartRepository.GetLstRoleId(apart.Id);
            result.data      = apart;
            result.code      = JsonModelCode.Succ;
            return(Json(result, JsonRequestBehavior.AllowGet));
        }