Beispiel #1
0
        public ActionResult UpdateEnabledMark(int id, int enabledMark)
        {
            SysRole entity = new SysRole
            {
                Id           = id,
                EnabledMark  = enabledMark,
                UpdateTime   = DateTime.Now,
                UpdateUserId = UserManager.GetCurrentUserInfo().Id
            };

            SysRoleService.Update(entity, new string[] { "EnabledMark", "UpdateTime", "UpdateUserId" });
            return(WriteSuccess("更新成功"));
        }
Beispiel #2
0
        public ActionResult Edit(int id, SysRoleViewModel viewModel)
        {
            if (ModelState.IsValid == false)
            {
                return(WriteError("实体验证失败"));
            }
            viewModel.Id           = id;
            viewModel.UpdateTime   = DateTime.Now;
            viewModel.UpdateUserId = UserManager.GetCurrentUserInfo().Id;
            SysRole entity = viewModel.EntityMap();

            SysRoleService.Update(entity, new string[] { "Name", "Code", "EnabledMark", "Remark", "UpdateTime", "UpdateUserId" });
            return(WriteSuccess());
        }
        public virtual IHttpActionResult Update(SysRoleUpdateRequest request)
        {
            var entity = new SysRole
            {
                Id = request.Id,
            };
            var result = _sysRoleService.Update(entity);

            if (result > 0)
            {
                return(Succeed(new SysRoleUpdateResponse
                {
                    Id = entity.Id
                }, "新增成功"));
            }
            else
            {
                return(Fail("新增失败"));
            }
        }
Beispiel #4
0
 public ResponseResult Update(int id, [FromBody] SysRole Role)
 {
     Role.Id = id;
     return(SysRoleService.Update(Role));
 }