The situation is this. In Main, I call the following code:
new GeneratedCode.WordGen().CreatePackage(@"D:\Temp\Output.docx", foo, ZAKAZCHIK); In the WordGen class, the CreatePackage method is called, which calls the CreateParts method, in which the GenerateMainDocumentPart1Content is called. The question is how do I transfer the ZAKAZCHIK to the GenerateMainDocumentPart1Content method?
How to transfer to CreatePackage is understandable, but I do not need it. Directly necessary method from main is impossible for me.
public void CreatePackage(string filePath, string foo, string ZAKAZCHIK) { using(WordprocessingDocument package = WordprocessingDocument.Create(filePath, WordprocessingDocumentType.Document)) { CreateParts(package); } } private void CreateParts(WordprocessingDocument document) { ExtendedFilePropertiesPart extendedFilePropertiesPart1 = document.AddNewPart<ExtendedFilePropertiesPart>("rId3"); GenerateExtendedFilePropertiesPart1Content(extendedFilePropertiesPart1); } } private void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1) {
CreatePartsandGenerateMainDocumentPart1Contentmethods one more parameterstring ZAKAZCHIKand pass. Or, which seems to me doubtful, make a class field, inCreatePackageassign it a value fromZAKAZCHIK, and inGenerateMainDocumentPart1Contenttake a value from it - DonilZAKAZCHIKsake,customer, notZAKAZCHIK! - VladD