B2022-083: Support Conditional RO Values

This commit is contained in:
Jake
2022-07-26 20:01:25 +00:00
parent 439cf9de7a
commit d327ab08af
16 changed files with 2670 additions and 1743 deletions

View File

@@ -6,6 +6,7 @@ using System.Data.SqlClient;
using Csla;
using Csla.Data;
using Csla.Validation;
using System.Diagnostics;
namespace VEPROMS.CSLA.Library
{
@@ -117,12 +118,15 @@ namespace VEPROMS.CSLA.Library
public static PdfInfo Get(ItemInfo sect, bool ovrride)
{
int count = 0;
while (count < 2)
{
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
PdfInfo myPdf = null;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
@@ -132,15 +136,19 @@ namespace VEPROMS.CSLA.Library
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
}
// ovrride forces the the printing of the word seciton, which creates a word file with resolved ROs, which is saved for an approved export
if (!ovrride || (ovrride && count ==1))
// override forces the printing of the word section, which creates a word file with resolved ROs, which is saved for an approved export
if (!ovrride || (ovrride && count == 1))
{
if (myPdf != null) return myPdf;
if (count > 0) return null; // Could not find or create a pdf
}
MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect);
count++;
}
return null;
}
}