コード例 #1
0
ファイル: Account.cs プロジェクト: panshuiqing/winform-ui
 private void ValidateOrg(List<BusinessRule> list, Person person, string prefix)
 {
     if (string.IsNullOrEmpty(this.Agent.Unit) || this.Agent.Unit.Length < 8)
     {
         list.Add(new BusinessRule(prefix + "��λ������д������"));
     }
     if (string.IsNullOrEmpty(this.Agent.UnitCode) || this.Agent.UnitCode.Length < 5)
     {
         list.Add(new BusinessRule(prefix + "��λע�������д������"));
     }
     if (string.IsNullOrEmpty(this.Agent.MobilePhone) || this.Agent.MobilePhone.Length < 7)
     {
         list.Add(new BusinessRule(prefix + "�绰��д������"));
     }
     if (!StringUtil.IsPostalCode(this.Agent.PostalCode))
     {
         list.Add(new BusinessRule(prefix + "�ʱ಻��ȷ"));
     }
 }
コード例 #2
0
ファイル: Account.cs プロジェクト: panshuiqing/winform-ui
 private void ValidatePerson(List<BusinessRule> list, Person person, string prefix)
 {
     if (person != null)
     {
         if (string.IsNullOrEmpty(person.PersonName) || person.PersonName.Length < 2)
         {
             list.Add(new BusinessRule(prefix + "�����������"));
         }
         if (string.IsNullOrEmpty(person.PassportNumber) || person.PassportNumber.Length < 5)
         {
             list.Add(new BusinessRule(prefix + "֤��������д������"));
         }
         else if (person.PassportType == "���֤" && !StringUtil.IsCardNo(person.PassportType))
         {
             list.Add(new BusinessRule(prefix + "���֤��д������"));
         }
         if (string.IsNullOrEmpty(person.Address) || person.Address.Length < 12)
         {
             list.Add(new BusinessRule(prefix + "��ַ��д������"));
         }
         if (string.IsNullOrEmpty(person.MobilePhone) || person.MobilePhone.Length < 7)
         {
             list.Add(new BusinessRule(prefix + "�绰��д������"));
         }
         if (!StringUtil.IsPostalCode(person.PostalCode))
         {
             list.Add(new BusinessRule(prefix + "�ʱ಻��ȷ"));
         }
     }
 }
コード例 #3
0
ファイル: Account.cs プロジェクト: panshuiqing/winform-ui
 public static Account Create(int tradeId, ApplyType applyType, Person Contact, Person Corporation, Person Agent, params Person[] unionBidPersons)
 {
     var account = new Account()
     {
         CreateTime = DateTime.Now,
         TradeId = tradeId,
         Status = AccountStatus.UnGrant,
         VerifyStatus = AccountVerifyStatus.NotifySupply,
         ApplyType = applyType,
         Contact = Contact,
         Corporation = Corporation,
         Agent = Agent,
         IsOnline = false
     };
     foreach (var item in unionBidPersons)
     {
         account.UnionBidPersons.Add(item);
     }
     return account;
 }