/// <summary> /// Saves the fields bound to the UI related elements as text files /// </summary> /// <param name="fileHandler">File Handler object used to call the method that writes to text files</param> public void SaveFieldsAsTextFiles(IFileHandler fileHandler) { string pathToSaveFiles = fileHandler.GetFolderPathToHandleFiles(); if (pathToSaveFiles != "") { if (CompanyInformation != string.Empty) { fileHandler.WriteToFile(CompanyInformation.Split('\r', '\n'), $"{nameof(CompanyInformation)}Text", pathToSaveFiles); } if (BuyerInformation != string.Empty) { fileHandler.WriteToFile(BuyerInformation.Split('\r', '\n'), $"{nameof(BuyerInformation)}Text", pathToSaveFiles); } if (ExporterStatementTitle != string.Empty) { fileHandler.WriteToFile(new string[] { ExporterStatementTitle }, $"{nameof(ExporterStatementTitle)}Text", pathToSaveFiles); } if (AffidavitTitle != string.Empty) { fileHandler.WriteToFile(new string[] { AffidavitTitle }, $"{nameof(AffidavitTitle)}Text", pathToSaveFiles); } if (ExporterStatementPart1 != string.Empty) { fileHandler.WriteToFile(ExporterStatementPart1.Split('\r', '\n'), $"{nameof(ExporterStatementPart1)}Text", pathToSaveFiles); } if (ExporterStatementPart2 != string.Empty) { fileHandler.WriteToFile(ExporterStatementPart2.Split('\r', '\n'), $"{nameof(ExporterStatementPart2)}Text", pathToSaveFiles); } if (ExporterStatementPart3 != string.Empty) { fileHandler.WriteToFile(ExporterStatementPart3.Split('\r', '\n'), $"{nameof(ExporterStatementPart3)}Text", pathToSaveFiles); } if (AffidavitContent != string.Empty) { fileHandler.WriteToFile(AffidavitContent.Split('\r', '\n'), $"{nameof(AffidavitContent)}Text", pathToSaveFiles); } if (SalesAgentName != string.Empty) { fileHandler.WriteToFile(new string[] { SalesAgentName }, $"{nameof(SalesAgentName)}Text", pathToSaveFiles); } if (PathToStampAndSignature != string.Empty) { fileHandler.WriteToFile(new string[] { PathToStampAndSignature }, $"{nameof(PathToStampAndSignature)}Text", pathToSaveFiles); } } }