Ejemplo n.º 1
0
        /// <summary>
        /// 删除身份认证申请
        /// </summary>
        /// <param name="identificationId">身份认证ID</param>
        /// <returns></returns>
        public bool DeleteIdentification(long identificationId)
        {
            Identification identification = iIdentificationRepository.Get(identificationId);

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

                //删除身份认证
                iIdentificationRepository.Delete(identification);

                //删除身份认证图片
                LogoService logoService = new LogoService(TenantTypeIds.Instance().Identification());
                logoService.DeleteLogo(identificationId);

                EventBus <Identification> .Instance().OnAfter(identification, new CommonEventArgs(EventOperationType.Instance().Delete()));

                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建身份认证申请
        /// </summary>
        /// <param name="identification">身份认证实体</param>
        /// <param name="stream">证件扫描件</param>
        /// <returns></returns>
        public bool CreateIdentification(Identification identification, Stream stream = null)
        {
            EventBus <Identification> .Instance().OnBefore(identification, new CommonEventArgs(EventOperationType.Instance().Create()));

            //创建身份认证
            identification.IdentificationLogo = string.Empty;
            iIdentificationRepository.Insert(identification);

            //创建身份认证图片
            if (stream != null)
            {
                //上传Logo
                LogoService logoService = new LogoService(TenantTypeIds.Instance().Identification());
                identification.IdentificationLogo = logoService.UploadLogo(identification.IdentificationId, stream);

                iIdentificationRepository.Update(identification);
            }

            EventBus <Identification> .Instance().OnAfter(identification, new CommonEventArgs(EventOperationType.Instance().Create()));

            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 创建身份认证申请
        /// </summary>
        /// <param name="identification">身份认证实体</param>
        /// <param name="stream">证件扫描件</param>
        /// <returns></returns>
        public bool CreateIdentification(Identification identification, Stream stream = null)
        {
            EventBus<Identification>.Instance().OnBefore(identification, new CommonEventArgs(EventOperationType.Instance().Create()));

            //创建身份认证
            identification.IdentificationLogo = string.Empty;
            iIdentificationRepository.Insert(identification);

            //创建身份认证图片
            if (stream != null)
            {
                //上传Logo
                LogoService logoService = new LogoService(TenantTypeIds.Instance().Identification());
                identification.IdentificationLogo = logoService.UploadLogo(identification.IdentificationId, stream);

                iIdentificationRepository.Update(identification);
            }

            EventBus<Identification>.Instance().OnAfter(identification, new CommonEventArgs(EventOperationType.Instance().Create()));

            return true;
        }
Ejemplo n.º 4
0
        public ActionResult _DisposeIdentification(IEnumerable <long> identificationIds, IdentificationStatus status)
        {
            foreach (var identificationId in identificationIds)
            {
                //根据认证申请Id获得认证申请实体
                Identification identification = identificationService.GetIdentification(identificationId);
                if (identification.Status != status)
                {
                    identification.Status = status;

                    //将认证申请的处理人Id改成当前用户的Id
                    identification.DisposerId = UserContext.CurrentUser.UserId;

                    //更新处理时间
                    identification.LastModified = DateTime.UtcNow;

                    //更新认证申请
                    identificationService.UpdateIdentification(identification);
                }
            }

            return(Json(new StatusMessageData(StatusMessageType.Success, "操作成功!")));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 将EditModel转为数据库实体
        /// </summary>
        /// <returns></returns>
        public Identification AsIdentification()
        {
            Identification identification = null;

            if (IdentificationId == 0)
            {
                identification = Identification.New();
            }
            else
            {
                identification = new IdentificationRepository().Get(this.IdentificationId);
            }
            identification.IdNumber             = this.IdNumber;
            identification.TrueName             = this.TrueName;
            identification.IdentificationTypeId = this.IdentificationTypeId;
            identification.Description          = this.Description;
            identification.Email  = this.Email;
            identification.Mobile = this.Mobile;
            identification.UserId = UserContext.CurrentUser.UserId;
            identification.Status = IdentificationStatus.pending;

            return(identification);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 新建实体时使用
 /// </summary>
 public static Identification New()
 {
     Identification identification = new Identification()
     {
         TrueName = string.Empty,
         Email = string.Empty,
         Mobile = string.Empty,
         Description = string.Empty,
         DateCreated = DateTime.UtcNow,
         LastModified = DateTime.UtcNow,
         DisposerId = 0
     };
     return identification;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 更新身份认证申请
        /// </summary>
        /// <param name="identification">身份认证实体</param>
        /// <param name="stream">证件扫描件</param>
        /// <returns></returns>
        public bool UpdateIdentification(Identification identification, Stream stream = null)
        {
            EventBus<Identification>.Instance().OnBefore(identification, new CommonEventArgs(EventOperationType.Instance().Update()));

            if (stream != null)
            {
                LogoService logoService = new LogoService(TenantTypeIds.Instance().Identification());

                logoService.DeleteLogo(identification.IdentificationId);
                identification.IdentificationLogo = logoService.UploadLogo(identification.IdentificationId, stream);
            }

            iIdentificationRepository.Update(identification);

            EventBus<Identification>.Instance().OnAfter(identification, new CommonEventArgs(EventOperationType.Instance().Update()));

            return true;
        }