/// <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;
        }
Beispiel #2
0
 public IdentificationTypeBusiness(IUnitOfWork _unitOfWork)
 {
     unitOfWork = _unitOfWork;
     repository = new IdentificationTypeRepository(unitOfWork);
 }
Beispiel #3
0
 public PersonController(PersonRepository personRepository, IdentificationTypeRepository identificationTypeRepository, PersonTypeRepository personTypeRepository)
     : base(personRepository)
 {
     _identificationTypeRepository = identificationTypeRepository;
     _personTypeRepository         = personTypeRepository;
 }
Beispiel #4
0
 public IdentificationTypeService(IdentificationTypeRepository repository)
     : base(repository)
 {
 }
 /// <summary>
 /// IdentificationService的构造函数
 /// </summary>
 /// <param name="identificationRepository"></param>
 /// <param name="identificationTypeRepository"></param>
 public IdentificationService(IdentificationRepository identificationRepository, IdentificationTypeRepository identificationTypeRepository)
 {
     this.iIdentificationRepository = identificationRepository;
     this.identificationTypeRepository = identificationTypeRepository;
 }
        /// <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;
        }
 public IdentificationTypesController(IdentificationTypeRepository identificationTypeRepository) : base(identificationTypeRepository)
 {
 }