Пример #1
0
        public async Task <IActionResult> ChangeUserStatus(User user)
        {
            dynamic model;

            try
            {
                user.CreatedBy = UserContext.UserID;
                await bALUser.UpdateUserStatusAsync(user);

                model = new { MessageType = "success", Message = user.IsActive ? "User Activated Successfully" : "User Deactivated Successfully" };
            }
            catch (Exception)
            {
                model = new { MessageType = "error", Message = "Error while changing user status" };
            }
            return(new JsonResult(model));
        }