Page Num Transition (for grids)

This commit is contained in:
2014-01-22 12:06:56 +00:00
parent cfb0981a22
commit 4e445bbe20
9 changed files with 245 additions and 26 deletions

View File

@@ -434,6 +434,26 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo ii in pi.MyItems)
SetParentSectionAndDocVersion(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo);
}
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{
if (itemInfo.MyContent.ContentPartCount > 0)
{
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
{
foreach (ItemInfo ii in pi.MyItems)
{
SetParentSectionAndDocVersionPageNum(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
}
}
}
if (itemInfo.MyContent.ContentTransitionCount > 0)
{
foreach (TransitionInfo traninfo in itemInfo.MyContent.ContentTransitions)
{
itemInfo.MyContent.FixTransitionText(traninfo, tranLookup);
}
}
}
//internal static long ticksROUsage;
//internal static long ticksItems;
//internal static long ticksTrans;
@@ -528,6 +548,18 @@ namespace VEPROMS.CSLA.Library
}
set { _PrintLevel = value; }
}
// The following property tracks the page number that this item is on if the resolved
// transition text has a Page Number associated with it. Formats that have this either
// have the UseTransitionModfier flag or have '{Page Num}' in respective transition formats.
// If the format requires page numbers in transitions text, two passes are run through the
// data for printing. The first determines page numbers, the seconds resolves the transition
// text.
private int _PageNumber = 0;
public int PageNumber
{
get { return _PageNumber; }
set { _PageNumber = value; }
}
private float _MSWordPageCount = 0;
public float MSWordPageCount
{
@@ -1194,7 +1226,7 @@ namespace VEPROMS.CSLA.Library
if (ActiveSection != null)
{
SectionInfo si = null;
if (IsSection) si = (SectionInfo) this;
if (IsSection) si = this as SectionInfo;
else si = ActiveSection as SectionInfo;
if(si == null)
si = SectionInfo.Get(ActiveSection.ItemID); //ActiveSection as SectionInfo;
@@ -4583,6 +4615,12 @@ namespace VEPROMS.CSLA.Library
{
return (Procedure) (_Editable = Procedure.Get(ItemID));
}
public static void RefreshPageNumTransitions(ProcedureInfo tmp)
{
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
SetParentSectionAndDocVersionPageNum(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, tranLookup);
}
//jcb add 20120501 item and children by unit
public static ProcedureInfo GetItemAndChildrenByUnit(int? itemID, int? parentID, int? unitID)
{