Ejemplo n.º 1
0
        public async Task <IActionResult> Update(UserStatusModel model)
        {
            if (model.Id <= 0)
            {
                return(RedirectToErrorPage());
            }

            var exist = _userStatusService.Find(model.Id);

            if (exist == null)
            {
                return(RedirectToErrorPage());
            }

            var status = new UserStatusModifyRequest()
            {
                Id          = model.Id,
                Name        = model.Name,
                Description = model.Description
            };
            await _userStatusService.UpdateAsync(status);

            return(RedirectToAction(nameof(Detail), new { id = status.Id }));
        }
Ejemplo n.º 2
0
 public async Task Update([FromBody] UserStatus userStatus)
 {
     await userStatusService.UpdateAsync(userStatus);
 }