本文整理汇总了C#中Utility.GetDocument方法的典型用法代码示例。如果您正苦于以下问题:C# Utility.GetDocument方法的具体用法?C# Utility.GetDocument怎么用?C# Utility.GetDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility.GetDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateDocument
private byte[] GenerateDocument(Business.ManagedItem managedItem, string systemManagedItemName, Guid itatSystemId, Utility.DocumentStorage documentStorageObject, Guid ITATDocumentID)
{
managedItem.SubstituteTerms();
string xml = managedItem.GetITATDocument(ITATDocumentID).CreateXml(false, systemManagedItemName, managedItem.ItemNumber, managedItem, ITATDocumentID);
#if DEBUG
string templateXml = managedItem.TemplateDef;
string folderName = @"C:\temp\ITAT\";
if (!System.IO.Directory.Exists(folderName))
System.IO.Directory.CreateDirectory(folderName);
string xmlFilename = string.Format("{0}GeneratedPDF-{1:yyyyMMdd-hhmmss}.xml", folderName, DateTime.Now);
if (System.IO.File.Exists(xmlFilename))
System.IO.File.Delete(xmlFilename);
System.IO.File.WriteAllText(xmlFilename, xml);
string templateFilename = string.Format("{0}Template-{1:yyyyMMdd-hhmmss}.xml", folderName, DateTime.Now);
if (System.IO.File.Exists(templateFilename))
System.IO.File.Delete(templateFilename);
System.IO.File.WriteAllText(templateFilename, templateXml);
#endif
//Changed for Multiple Documents
//get the template's Extensions (if any) from the DocumentStore (e.g. Documentum) and call the PDF Service to generate the PDF document
byte[] rtn;
int extensionCount = managedItem.Extensions.Count;
if (extensionCount > 0 && (managedItem.GetITATDocument(ITATDocumentID).DefaultDocument ?? false))
{
byte[][] extensions = new byte[managedItem.Extensions.Count][];
for (int i = 0; i < extensionCount; i++)
{
string extensionContentType = string.Empty;
extensions[i] = documentStorageObject.GetDocument(itatSystemId, managedItem.Extensions[i].ObjectID, out extensionContentType);
}
rtn = Kindred.Common.WebServices.WebServiceFactory<PDFService.Service>.CreateService(Kindred.Common.WebServices.EnvironmentDetectionMode.Machine).GeneratePDF2(xml, ((managedItem.GetITATDocument(ITATDocumentID).WorkflowEnabled ?? false) && (managedItem.State.IsDraft ?? false)), extensions, true, true);
}
else
{
rtn = Kindred.Common.WebServices.WebServiceFactory<PDFService.Service>.CreateService(Kindred.Common.WebServices.EnvironmentDetectionMode.Machine).GeneratePDF4(xml, ((managedItem.GetITATDocument(ITATDocumentID).WorkflowEnabled ?? false) && (managedItem.State.IsDraft ?? false)), true, true);
}
return rtn;
}