/// <summary>
        /// 将EditModel转为数据库实体
        /// </summary>
        /// <returns></returns>
        public IdentificationType AsIdentificationType()
        {
            IdentificationType identificationtype = null;

            if (IdentificationTypeId == 0)
            {
                identificationtype = IdentificationType.New();
            }
            else
            {
                identificationtype = new IdentificationTypeRepository().Get(this.IdentificationTypeId);
            }
            identificationtype.CreaterId   = UserContext.CurrentUser.UserId;
            identificationtype.DateCreated = DateTime.Now;
            identificationtype.Description = this.Description;
            identificationtype.Enabled     = this.Enabled;
            identificationtype.Name        = this.Name;

            return(identificationtype);
        }
        /// <summary>
        /// 删除认证标识
        /// </summary>
        /// <param name="identificationTypeId">认证标识ID</param>
        /// <returns></returns>
        public bool DeleteIdentificationType(long identificationTypeId)
        {
            IdentificationType identificationType = identificationTypeRepository.Get(identificationTypeId);

            if (identificationType != null)
            {
                EventBus <IdentificationType> .Instance().OnBefore(identificationType, new CommonEventArgs(EventOperationType.Instance().Delete()));

                //删除认证标识和该认证标识下的所有申请
                IdentificationTypeRepository typeRepository = new IdentificationTypeRepository();
                typeRepository.DeleteIdentificationTypes(identificationTypeId);

                //删除认证标识图
                LogoService logoService = new LogoService(TenantTypeIds.Instance().IdentificationType());
                logoService.DeleteLogo(identificationTypeId);

                EventBus <IdentificationType> .Instance().OnAfter(identificationType, new CommonEventArgs(EventOperationType.Instance().Delete()));

                return(true);
            }
            return(false);
        }
 /// <summary>
 /// IdentificationService的构造函数
 /// </summary>
 /// <param name="identificationRepository"></param>
 /// <param name="identificationTypeRepository"></param>
 public IdentificationService(IdentificationRepository identificationRepository, IdentificationTypeRepository identificationTypeRepository)
 {
     this.iIdentificationRepository    = identificationRepository;
     this.identificationTypeRepository = identificationTypeRepository;
 }