/// <summary> /// 删除Logo /// </summary> /// <param name="recommendId">群组Id</param> public void DeleteLogo(long groupId) { LogoService logoService = new LogoService(TenantTypeIds.Instance().Group()); logoService.DeleteLogo(groupId); GroupEntity group = Get(groupId); if (group == null) { return; } group.Logo = string.Empty; groupRepository.Update(group); }
/// <summary> /// 删除Logo /// </summary> /// <param name="sectionId">帖吧Id</param> public void DeleteLogo(long sectionId) { LogoService logoService = new LogoService(TenantTypeIds.Instance().BarSection()); logoService.DeleteLogo(sectionId); BarSection section = barSectionRepository.Get(sectionId); if (section == null) { return; } section.LogoImage = string.Empty; barSectionRepository.Update(section); }
/// <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); }
/// <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> /// 删除身份认证申请 /// </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); }
/// <summary> /// 删除群组 /// </summary> /// <param name="groupId">群组Id</param> public void Delete(long groupId) { //设计要点 //1、需要删除:群组成员、群组申请、Logo; GroupEntity group = groupRepository.Get(groupId); if (group == null) { return; } CategoryService categoryService = new CategoryService(); categoryService.ClearCategoriesFromItem(groupId, null, TenantTypeIds.Instance().Group()); EventBus <GroupEntity> .Instance().OnBefore(group, new CommonEventArgs(EventOperationType.Instance().Delete())); int affectCount = groupRepository.Delete(group); if (affectCount > 0) { //删除访客记录 new VisitService(TenantTypeIds.Instance().Group()).CleanByToObjectId(groupId); //用户的创建群组数-1 OwnerDataService ownerDataService = new OwnerDataService(TenantTypeIds.Instance().User()); ownerDataService.Change(group.UserId, OwnerDataKeys.Instance().CreatedGroupCount(), -1); //删除Logo LogoService logoService = new LogoService(TenantTypeIds.Instance().Group()); logoService.DeleteLogo(groupId); //删除群组下的成员 DeleteMembersByGroupId(groupId); EventBus <GroupEntity> .Instance().OnAfter(group, new CommonEventArgs(EventOperationType.Instance().Delete())); EventBus <GroupEntity, AuditEventArgs> .Instance().OnAfter(group, new AuditEventArgs(group.AuditStatus, null)); } }