public virtual async Task <bool> RemoveAllRelationByAttachmentName(string imgName) { var list = FileAttachmentRepository.GetModels(a => a.fileName == imgName); var queryList = await list.ToListAsync(); foreach (var item in queryList) { await TravelFileAttachmentService.RemoveAllFileRelationAsync(item.id); } return(await FileAttachmentRepository.DeleteListAsync(queryList)); }
public AccountBusiness(IUnitOfWork _unitOfWork) { unitOfWork = _unitOfWork; accountRepository = new AccountRespository(unitOfWork); accountTypeRepository = new AccountTypeRespository(unitOfWork); tagRepository = new TagRepository(unitOfWork); accountTagRepository = new AccountTagRepository(unitOfWork); taskItemRepository = new TaskItemRepository(unitOfWork); contactRepository = new ContactRepository(unitOfWork); fileAttachmentRepository = new FileAttachmentRepository(unitOfWork); salesOrderRepository = new SalesOrderRepository(unitOfWork); accountCaseRepository = new AccountCaseRepository(unitOfWork); }
public LeadBusiness(IUnitOfWork _unitOfWork) { unitOfWork = _unitOfWork; leadRepository = new LeadRepository(unitOfWork); taskItemRepository = new TaskItemRepository(unitOfWork); stageRepository = new StageRepository(unitOfWork); leadAuditBusiness = new LeadAuditBusiness(unitOfWork); accountRepository = new AccountRespository(_unitOfWork); contactRepository = new ContactRepository(_unitOfWork); moduleRepository = new ModuleRepository(_unitOfWork); leadStatusRepository = new LeadStatusRepository(_unitOfWork); fileAttachmentrepository = new FileAttachmentRepository(_unitOfWork); stageBusiness = new StageBusiness(_unitOfWork); ratingBusiness = new RatingBusiness(_unitOfWork); leadContactRepository = new LeadContactRepository(_unitOfWork); accountcontactRepository = new AccountContactRepository(_unitOfWork); salesOrderRepository = new SalesOrderRepository(_unitOfWork); tagRepository = new TagRepository(_unitOfWork); leadTagRepository = new LeadTagRepository(_unitOfWork); }
public FileAttachmentBusiness(IUnitOfWork _unitOfWork) { unitOfWork = _unitOfWork; fileAttachmentRepository = new FileAttachmentRepository(unitOfWork); }
/// <summary> /// 根据id获取附件路径 /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <string> GetFilePathByIdAsync(int id) { var file = await FileAttachmentRepository.GetSingleModelAsync(a => a.id == id); return(file.path); }
public async Task <PageDTO <FileAttachmentEntity> > GetFileAttachmentListByPageAsync(int pageIndex, int pageSize) { List <FileAttachmentEntity> list = await FileAttachmentRepository.GetModelsByPage(pageSize, pageIndex, true, a => a.createDate, a => true, out var total).ToListAsync(); return(new PageDTO <FileAttachmentEntity>(pageIndex, pageSize, total, list)); }
/// <summary> /// 根据id获取附件对象 /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <FileAttachmentEntity> GetAttachmentByIdAsync(int id) { return(await FileAttachmentRepository.GetSingleModelAsync(a => a.id == id)); }