コード例 #1
0
        public IdentifyCodeOutput GenerateIdentifyCode(string account, AccountRegistType accountType)
        {
            var identifyCode = _identifyCodeQueryService.GetIdentifyCode(account);
            var code         = RandomHelper.GenerateIdentifyCode();
            var output       = new IdentifyCodeOutput
            {
                IdentifyCodeId                                           = identifyCode == null?Guid.NewGuid().ToString() : identifyCode.Id,
                                                          Code           = code,
                                                          ExpirationDate = DateTime.Now.AddMinutes(_identifyCodeDuration),
                                                          IsNew          = identifyCode == null,
            };

            return(output);
        }
コード例 #2
0
 public UserInfo(
     string id,
     string userName,
     string email,
     string phone,
     string password,
     bool isActive,
     ClientRegistType clientRegistType,
     AccountRegistType accountRegistType,
     int points
     ) : base(id)
 {
     UserName            = userName;
     Email               = email;
     Phone               = phone;
     Password            = password;
     IsActive            = isActive;
     ClientRegistType    = clientRegistType;
     CreateTime          = DateTime.Now;
     IsDelete            = false;
     AccountRegistType   = accountRegistType;
     Points              = points;
     Balance             = 0;
     TotalRecharge       = 0;
     TotalConsumeAccount = 0;
     PointCount          = 0;
     AmountCount         = 0;
     ApplyEvent(new AddUserInfoEvent(UserName,
                                     Email,
                                     Phone,
                                     Password,
                                     IsActive,
                                     ClientRegistType,
                                     IsDelete,
                                     AccountRegistType,
                                     Points,
                                     Balance,
                                     TotalRecharge,
                                     TotalConsumeAccount,
                                     PointCount,
                                     AmountCount
                                     ));
 }
コード例 #3
0
 public AddUserInfoEvent(string userName,
                         string email,
                         string phone,
                         string password,
                         bool isActive,
                         ClientRegistType clientRegistType,
                         bool isDelete,
                         AccountRegistType accountRegistType, int points)
 {
     UserName          = userName;
     Email             = email;
     Phone             = phone;
     Password          = password;
     IsActive          = isActive;
     ClientRegistType  = clientRegistType;
     CreateTime        = DateTime.Now;
     IsDelete          = isDelete;
     AccountRegistType = accountRegistType;
     Points            = points;
 }
コード例 #4
0
 public AddUserInfoEvent(string userName, string email, string phone, string password,
                         bool isActive, ClientRegistType clientRegistType, bool isDelete,
                         AccountRegistType accountRegistType, int points, int balance,
                         int totalRecharge, int totalConsumeAccount, int pointCount, int amountCount)
 {
     UserName            = userName;
     Email               = email;
     Phone               = phone;
     Password            = password;
     IsActive            = isActive;
     ClientRegistType    = clientRegistType;
     CreateTime          = DateTime.Now;
     IsDelete            = isDelete;
     AccountRegistType   = accountRegistType;
     Points              = points;
     TotalRecharge       = totalConsumeAccount;
     TotalConsumeAccount = totalConsumeAccount;
     AmountCount         = amountCount;
     Balance             = balance;
     PointCount          = pointCount;
 }
コード例 #5
0
        public AddUserInfoCommand(string id, string account, string password, ClientRegistType clientRegistType, AccountRegistType accountRegistType, int points) : base(id)
        {
            switch (accountRegistType)
            {
            case AccountRegistType.UserName:
                UserName = account;
                break;

            case AccountRegistType.Email:
                Email = account;
                break;

            case AccountRegistType.Phone:
                Phone = account;
                break;
            }
            AccountRegistType = accountRegistType;
            Password          = password;
            ClientRegistType  = clientRegistType;
            Points            = points;
        }
コード例 #6
0
        private string EncryptPassword(string userAccount, string userPassword, AccountRegistType accountRegType)
        {
            var pwd = Hash.Create(HashType.MD5, userAccount + userPassword, accountRegType.ToString(), true);

            return(pwd);
        }