Beispiel #1
0
 private void DoSubmitVerify(string content)
 {
     if (CanSubmitVerify())
     {
         if (content == null)
         {
             this.VerifyStatus = AccountVerifyStatus.Submited;
         }
         var verify = new AccountVerify()
         {
             AccountId = this.ID,
             CreateTime = DateTime.Now,
             Content = content,
             Status = this.VerifyStatus,
         };
         this.AccountVerifies.Add(verify);
         DomainEvents.Publish(new SubmitVerifyEvent() { Account = this, AccountVerify = verify });
     }
     else
     {
         throw new SubmitApplyException("��ǰ�������ύ���");
     }
 }
Beispiel #2
0
 /// <summary>
 /// ��̨����Ա���
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(int userId, string content, VerifyType verifyType)
 {
     if (CanVerifyByUser())
     {
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId = this.ID,
             Content = content,
             CreateTime = DateTime.Now,
             Status = this.VerifyStatus,
             UserId = userId,
         });
         DomainEvents.Publish(new VerifyByUserEvent() { Account = this });
     }
     else
     {
         throw new VerifyApplyException("��ǰ���������");
     }
 }
Beispiel #3
0
 /// <summary>
 /// ��̨����Ա���
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(string content, User user, VerifyType verifyType)
 {
     if (CanVerifyByUser)
     {
         if (user == null) throw new ArgumentNullException("user");
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId = this.ID,
             Content = content,
             CreateTime = DateTime.Now,
             IsAdmin = true,
             Status = this.VerifyStatus,
             VerifyAccountId = user.ID,
             VerifyAccount = user.UserName,
         });
         if (verifyType == VerifyType.Verified)
         {
             this.Status = AccountStatus.Initiation;
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// ���룬ע��
 /// </summary>
 public void Apply(Trade trade)
 {
     this.Trade = trade;
     this.RandomNumber = GenerateRandomNumber();
     this.CreateTime = DateTime.Now;
     this.Status = AccountStatus.Normal;
     this.VerifyStatus = AccountVerifyStatus.UnSubmit;
 }
Beispiel #5
0
 /// <summary>
 /// �ύ���
 /// </summary>
 /// <param name="content"></param>
 public void SubmitVerify(string content)
 {
     if (CanSubmitVerify)
     {
         this.VerifyStatus = AccountVerifyStatus.Submited;
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId = this.ID,
             Content = content,
             CreateTime = DateTime.Now,
             IsAdmin = false,
             Status = this.VerifyStatus,
             VerifyAccountId = this.ID,
             VerifyAccount = GetAccountName(),
         });
     }
 }