private async Task InitializeDescription(List <DocumentFileInfo> documents, DocumentsCompareDto documentsCompareDto) { switch (_protectionDocTypeCode) { case DicProtectionDocType.Codes.Invention: documentsCompareDto.Description = await GetOriginalTextFromDocumentFile(documents, DicDocumentTypeCodes.InventionDescription); var inventionInfo = await GetChangedTextFromDocumentFile(documents, DicDocumentTypeCodes.ChangedInventionDescription); documentsCompareDto.ChangedDescription = inventionInfo.text; documentsCompareDto.ChangedDescriptionDocId = inventionInfo.documentId; break; case DicProtectionDocType.Codes.UsefulModel: // TODO на данный момент нет подходящих типов документа break; case DicProtectionDocType.Codes.IndustrialModel: // TODO на данный момент нет подходящих типов документа break; default: throw new ArgumentOutOfRangeException(); } }
private async Task InitializeEssay(List <DocumentFileInfo> documents, DocumentsCompareDto documentsCompareDto) { documentsCompareDto.Essay = await GetOriginalTextFromDocumentFile(documents, DicDocumentTypeCodes.Essay, DicDocumentTypeCodes.EssayForeign); var essayInfo = await GetChangedTextFromDocumentFile(documents, DicDocumentTypeCodes.ChangedEssay); documentsCompareDto.ChangedEssay = essayInfo.text; documentsCompareDto.ChangedEssayDocId = essayInfo.documentId; }
public async Task <DocumentsCompareDto> GetDocumentsInfoForCompare(int requestId) { var protectionDocTypeCode = await GetProtectionDocTypeCode(requestId); if (string.IsNullOrEmpty(protectionDocTypeCode) || !GetNecessaryProtectionDocTypeCodes().Contains(protectionDocTypeCode)) { return(null); } _protectionDocTypeCode = protectionDocTypeCode; var documentsInfo = new DocumentsCompareDto(); List <DocumentFileInfo> documents; switch (_protectionDocTypeCode) { case DicProtectionDocType.Codes.Invention: { documents = GetNecessaryDocumentsFileInfo(requestId, DicProtectionDocType.Codes.Invention); break; } case DicProtectionDocType.Codes.IndustrialModel: { documents = GetNecessaryDocumentsFileInfo(requestId, DicProtectionDocType.Codes.IndustrialModel); break; } case DicProtectionDocType.Codes.UsefulModel: { documents = GetNecessaryDocumentsFileInfo(requestId, DicProtectionDocType.Codes.UsefulModel); break; } default: return(null); } if (documents == null) { return(null); } await InitializeDescription(documents, documentsInfo); await InitializeEssay(documents, documentsInfo); await InitializeFormula(documents, documentsInfo); return(documentsInfo); }