public async Task <InitWorkFlowOutput> Create(OATenderCashInputDto input) { var model = input.MapTo <OATenderCash>(); model.Status = 0; model.Id = Guid.NewGuid(); if (input.FileList != null) { var fileList = new List <AbpFileListInput>(); foreach (var item in input.FileList) { fileList.Add(new AbpFileListInput() { Id = item.Id, Sort = item.Sort }); } await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput() { BusinessId = model.Id.ToString(), BusinessType = (int)AbpFileBusinessType.OA投标文件申请附件, Files = fileList }); } _oaTenderCashRepository.InsertOrUpdate(model); return(new InitWorkFlowOutput() { InStanceId = model.Id.ToString() }); }
public async Task Update(OATenderCashInputDto input) { var ret = _oaTenderCashRepository.Get(input.Id.Value); ret = input.MapTo(ret); var fileList = new List <AbpFileListInput>(); if (input.FileList != null) { foreach (var item in input.FileList) { fileList.Add(new AbpFileListInput() { Id = item.Id, Sort = item.Sort }); } } await _abpFileRelationAppService.UpdateAsync(new CreateFileRelationsInput() { BusinessId = input.Id.ToString(), BusinessType = (int)AbpFileBusinessType.OA投标文件申请附件, Files = fileList }); _oaTenderCashRepository.Update(ret); }