示例#1
0
 public void ChangeStatus(
     [NotNull] TUserExtension user,
     SnsStatusType statusType)
 {
     Check.NotNull(user, nameof(user));
     //
     user.ChangeStatus(statusType);
 }
示例#2
0
 public void ChangeLogo(
     [NotNull] TUserExtension user,
     [NotNull] string logo)
 {
     Check.NotNull(user, nameof(user));
     Check.NotNullOrWhiteSpace(logo, nameof(logo));
     //
     user.ChangeLogo(logo);
 }
示例#3
0
 public void ChangeDisplayName(
     [NotNull] TUserExtension user,
     [NotNull] string displayName)
 {
     Check.NotNull(user, nameof(user));
     Check.NotNullOrWhiteSpace(displayName, nameof(displayName));
     //
     user.ChangeDisplayName(displayName);
 }
示例#4
0
        public async Task ChangeBusinessNameAsync(
            [NotNull] TUserExtension user,
            [NotNull] string newBusinessName)
        {
            Check.NotNull(user, nameof(user));
            Check.NotNullOrWhiteSpace(newBusinessName, nameof(newBusinessName));
            //
            var existingUser = await _userExtRepository.CheckBusinessNameAsync(user.UserId, newBusinessName);

            if (existingUser != null)
            {
                throw new UserBusinessNameAlreadyExistsException(newBusinessName);
            }
            //
            user.ChangeBusinessName(newBusinessName);
        }
示例#5
0
        public async Task ChangeSocialCreditCodeAsync(
            [NotNull] TUserExtension user,
            [NotNull] string newSocialCreditCode,
            [NotNull] string newSocialCreditCodeImg)
        {
            Check.NotNull(user, nameof(user));
            Check.NotNullOrWhiteSpace(newSocialCreditCode, nameof(newSocialCreditCode));
            Check.NotNullOrWhiteSpace(newSocialCreditCodeImg, nameof(newSocialCreditCodeImg));
            //
            var existingUser = await _userExtRepository.CheckSocialCreditCodeAsync(user.UserId, newSocialCreditCode);

            if (existingUser != null)
            {
                throw new UserSocialCreditCodeAlreadyExistsException(newSocialCreditCode);
            }
            //
            user.ChangeSocialCreditCode(newSocialCreditCode, newSocialCreditCodeImg);
        }
示例#6
0
        public async Task ChangeIdentityCardAsync(
            [NotNull] TUserExtension user,
            [NotNull] string newIdentityCardNo,
            [NotNull] string newIdentityCardImg,
            [NotNull] string newIdentityCardName)
        {
            Check.NotNull(user, nameof(user));
            Check.NotNullOrWhiteSpace(newIdentityCardNo, nameof(newIdentityCardNo));
            Check.NotNullOrWhiteSpace(newIdentityCardImg, nameof(newIdentityCardImg));
            Check.NotNullOrWhiteSpace(newIdentityCardName, nameof(newIdentityCardName));
            //
            var existingUser = await _userExtRepository.CheckIdentityCardAsync(user.UserId, newIdentityCardNo);

            if (existingUser != null)
            {
                throw new UserIdentityCardAlreadyExistsException(newIdentityCardNo);
            }
            //
            user.ChangeIdentityCard(newIdentityCardNo, newIdentityCardImg, newIdentityCardName);
        }