Support for SAMGS Supplemental Information

This commit is contained in:
2017-05-03 13:57:12 +00:00
parent 419dd4712a
commit e7f9d4e3ed
8 changed files with 210 additions and 22 deletions

View File

@@ -509,6 +509,9 @@ namespace VEPROMS.CSLA.Library
case E_FromType.Table:
myItemInfo._Tables = pi.MyItems;
break;
case E_FromType.SupInfo:
myItemInfo._SupInfos = pi.MyItems;
break;
}
foreach (ItemInfo ii in pi.MyItems)
{
@@ -846,7 +849,7 @@ namespace VEPROMS.CSLA.Library
// Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds);
// Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds);
//}
internal static string GetCombinedTab(ItemInfo itemInfo, string parTab)
public static string GetCombinedTab(ItemInfo itemInfo, string parTab)
{
string pTab = parTab == null ? "" : parTab;
int profileDepth = ProfileTimer.Push(">>>> itemInfo.MyTab.CleanText.Trim");
@@ -1787,6 +1790,16 @@ namespace VEPROMS.CSLA.Library
return retval;
}
}
public bool IsSupInfoPart
{
get
{
if (FromType != null)
return (FromType == E_FromType.SupInfo);
bool retval = ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.SupInfo));
return retval;
}
}
public bool IsInRNO
{
get
@@ -1798,6 +1811,17 @@ namespace VEPROMS.CSLA.Library
return parent.IsInRNO;
}
}
public bool IsInSupInfo
{
get
{
if (IsHigh) return false;
if (IsSupInfoPart) return true;
ItemInfo parent = ActiveParent as ItemInfo;
if (parent == null) return false;
return parent.IsInSupInfo;
}
}
public bool IsRtfRaw
{
get
@@ -2903,11 +2927,11 @@ namespace VEPROMS.CSLA.Library
}
#endregion
#region Lookups and More Related
private ItemInfoList Lookup(int fromType, ref ItemInfoList itemInfoList)
private ItemInfoList Lookup(E_FromType fromType, ref ItemInfoList itemInfoList)
{
//Console.WriteLine(itemInfoList);
if (itemInfoList == null)
itemInfoList = Lookup(fromType);
itemInfoList = Lookup((int)fromType);
return itemInfoList;
}
private bool _LoadAllAtOnce;
@@ -2958,28 +2982,32 @@ namespace VEPROMS.CSLA.Library
_RNOs = null;
_Steps = null;
_Tables = null;
_SupInfos = null;
}
private ItemInfoList _Procedures;
public ItemInfoList Procedures
{ get { return Lookup(1, ref _Procedures); } }
{ get { return Lookup(E_FromType.Procedure, ref _Procedures); } }
private ItemInfoList _Sections;
public ItemInfoList Sections
{ get { return Lookup(2, ref _Sections); } }
{ get { return Lookup(E_FromType.Section, ref _Sections); } }
private ItemInfoList _Cautions;
public ItemInfoList Cautions
{ get { return Lookup(3, ref _Cautions); } }
{ get { return Lookup(E_FromType.Caution, ref _Cautions); } }
private ItemInfoList _Notes;
public ItemInfoList Notes
{ get { return Lookup(4, ref _Notes); } }
{ get { return Lookup(E_FromType.Note, ref _Notes); } }
private ItemInfoList _RNOs;
public ItemInfoList RNOs
{ get { return Lookup(5, ref _RNOs); } }
{ get { return Lookup(E_FromType.RNO, ref _RNOs); } }
private ItemInfoList _Steps;
public ItemInfoList Steps
{ get { return Lookup(6, ref _Steps); } }
{ get { return Lookup(E_FromType.Step, ref _Steps); } }
private ItemInfoList _Tables;
public ItemInfoList Tables
{ get { return Lookup(7, ref _Tables); } }
{ get { return Lookup(E_FromType.Table, ref _Tables); } }
private ItemInfoList _SupInfos;
public ItemInfoList SupInfos
{ get { return Lookup(E_FromType.SupInfo, ref _SupInfos); } }
//public void ResetChildren()
//{
// _Procedures = null;
@@ -3550,6 +3578,13 @@ namespace VEPROMS.CSLA.Library
}
_TagsSetup = true;
}
public bool SupplementalInformation
{
get
{
return MyDocStyle == null ? false : MyDocStyle.SupplementalInformation;
}
}
protected void SetTabText()
{
if (IsSection) // B2016-160 Support transitions to sections
@@ -3558,6 +3593,14 @@ namespace VEPROMS.CSLA.Library
_MyTab.CleanText = DisplayNumber;
return;
}
// this is used for edit, print uses combinedtabs in the print code. When combined tabs were used for edit,
// part of the supinfo text overwrote tabs on screen.
if (IsSupInfoPart)
{
_MyTab.Text = MyParent.MyTab.Text;
_MyTab.CleanText = MyParent.MyTab.CleanText;
return;
}
string cltext = null;
int stepType = (int)(MyContent.Type % 10000);
string tbformat;
@@ -4941,7 +4984,6 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
}
#endregion ItemInfo
#region Tab
@@ -6225,6 +6267,27 @@ namespace VEPROMS.CSLA.Library
[Serializable()]
public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly
{
private bool? _ProcHasSupInfoData = null;
public bool ProcHasSupInfoData
{
get
{
if (_ProcHasSupInfoData == null)
{
_ProcHasSupInfoData = GetProcHasSupInfoData();
}
return (bool)_ProcHasSupInfoData;
}
set { _ProcHasSupInfoData = value; }
}
private bool GetProcHasSupInfoData()
{
foreach (SectionInfo mySection in Sections)
{
if (mySection.MyDocStyle.SupplementalInformation && mySection.HasSupInfoSteps) return true;
}
return false;
}
public bool CreateEnhanced = false;
public string PDFNumber
{
@@ -6822,6 +6885,30 @@ namespace VEPROMS.CSLA.Library
[Serializable()]
public partial class SectionInfo : ItemInfo, IVEDrillDownReadOnly
{
// Determine if this section contains any Supplemental information steps. This is used for print to determine
// whether some of the supinfo processing needs to occur.
private bool? _HasSupInfoSteps = null;
public bool HasSupInfoSteps
{
get
{
if (_HasSupInfoSteps == null)
{
_HasSupInfoSteps = GetSupInfoSteps(this);
}
return (bool)_HasSupInfoSteps;
}
set { _HasSupInfoSteps = value; }
}
private static bool GetSupInfoSteps(ItemInfo ii)
{
if (ii.SupInfos != null && ii.SupInfos.Count > 0) return true;
if (ii.MyContent.ContentParts != null)
foreach (PartInfo pi in ii.MyContent.ContentParts)
foreach (ItemInfo iic in pi.MyItems)
if (GetSupInfoSteps(iic)) return true;
return false;
}
private bool? _HasStepCheckOffs = null;
public bool HasStepCheckOffs
{

View File

@@ -356,6 +356,7 @@ namespace VEPROMS.CSLA.Library
tmp.UpdateROText();
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
((ItemInfo)ActiveParent).MyContent.RefreshContentParts();
if (tmp.IsSupInfoPart) (MyActiveSection as SectionInfo).HasSupInfoSteps = true;
return tmp;
}
private ItemInfo InsertSmartTemplateSubStep(string text, string number, ItemInfo tmp, EAddpingPart adPart, int type, E_FromType fromTypeTop)
@@ -698,6 +699,7 @@ namespace VEPROMS.CSLA.Library
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
tmp.UpdateTransitionText();
tmp.UpdateROText();
if (tmp.IsSupInfoPart) (MyActiveSection as SectionInfo).HasSupInfoSteps = true;
OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After));
return tmp;
}
@@ -867,6 +869,8 @@ namespace VEPROMS.CSLA.Library
tmp.UpdateTransitionText();
tmp.UpdateROText();
MyContent.RefreshContentParts();
ResetParts();
if (tmp.IsSupInfoPart) (MyActiveSection as SectionInfo).HasSupInfoSteps = true;
OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child));
return tmp;
}

View File

@@ -103,6 +103,9 @@ namespace VEPROMS.CSLA.Library
else
partText = ".Table";
break;
case E_FromType.SupInfo:
partText = ".SupInfo";
break;
default:
break;
}
@@ -244,10 +247,10 @@ namespace VEPROMS.CSLA.Library
public enum E_FromType : int
{
Procedure = 1, Section = 2, Caution = 3, Note = 4, RNO = 5, Step = 6, Table = 7
Procedure = 1, Section = 2, Caution = 3, Note = 4, RNO = 5, Step = 6, Table = 7, SupInfo = 8
}
public enum E_FromTypes : int
{
Procedures = 1, Sections = 2, Cautions = 3, Notes = 4, RNOs = 5, Steps = 6, Tables = 7
Procedures = 1, Sections = 2, Cautions = 3, Notes = 4, RNOs = 5, Steps = 6, Tables = 7, SupInfos = 8
}
}