public async Task <IActionResult> Edit(long id)
        {
            ListAdminUserDTO adminUser = await AdminUserSvc.GetByIdAsync(id);

            if (adminUser == null)
            {
                return(NotFound());
            }

            var roles = await RoleSvc.GetAllAsync();

            var adminUserRoles = await RoleSvc.GetByAdminUserId(id);

            if (adminUserRoles == null)
            {
                adminUserRoles = new List <ListRolePermissionDTO>();
            }
            if (roles == null)
            {
                roles = new List <ListRolePermissionDTO>();
            }
            UpdateAdminUserListModel model = new UpdateAdminUserListModel();

            model.Age            = adminUser.Age;
            model.CreateTime     = adminUser.CreateTime;
            model.Gender         = adminUser.Gender;
            model.Id             = adminUser.Id;
            model.Name           = adminUser.Name;
            model.PhoneNum       = adminUser.PhoneNum;
            model.Roles          = roles;
            model.AdminUserRoles = adminUserRoles;
            return(View(model));
        }
        private ListAdminUserDTO TODTO(AdminUserEntity entity)
        {
            ListAdminUserDTO dto = new ListAdminUserDTO();

            dto.Age            = entity.Age;
            dto.CreateTime     = entity.CreateTime;
            dto.Gender         = entity.Gender;
            dto.Id             = entity.Id;
            dto.LoginErrorTime = entity.LoginErrorTime;
            dto.Name           = entity.Name;
            dto.PhoneNum       = entity.PhoneNum;
            return(dto);
        }