B2018-118: Enhanced tabs are incorrect when mix of (linked & unlinked) Cautions/Notes
This commit is contained in:
parent
06e24894a3
commit
a2c3844ffd
@ -3750,9 +3750,34 @@ namespace VEPROMS.CSLA.Library
|
||||
EnhancedDocuments eds = GetMyEnhancedDocuments();
|
||||
if (eds != null && eds.Count == 1 && eds[0].Type == 0)
|
||||
{
|
||||
// B2018-114 check for a null before getting the Ordinal value (code that uses this handles a Null return value from this Get
|
||||
ItemInfo srcItem = ItemInfo.Get(eds[0].ItemID);
|
||||
if (srcItem != null) // B2018-114 check for a null before getting the Ordinal value (code that uses this handles a Null return value from this Get
|
||||
return srcItem.Ordinal;
|
||||
if (srcItem == null) return null;
|
||||
if (srcItem.IsHigh) return srcItem.Ordinal;
|
||||
// B2018-118: the LinkedOrdinal count must take into account cautions versus notes types:
|
||||
ItemInfo hls = srcItem.MyHLS;
|
||||
bool enIsCaution = this.IsCaution;
|
||||
// get the first sibling and go through list for each type - go through notes first then cautions checking for each type:
|
||||
// go through cautions first because these are the first parts:
|
||||
int? ord = 0;
|
||||
if (hls.Cautions != null && hls.Cautions.Count > 0)
|
||||
{
|
||||
foreach (ItemInfo caut in hls.Cautions)
|
||||
{
|
||||
if (caut.IsCaution && enIsCaution) ord++;
|
||||
if (caut.IsNote && !enIsCaution) ord++;
|
||||
if (caut.ItemID == srcItem.ItemID) return ord;
|
||||
}
|
||||
}
|
||||
if (hls.Notes != null && hls.Notes.Count > 0)
|
||||
{
|
||||
foreach (ItemInfo note in hls.Notes)
|
||||
{
|
||||
if (note.IsCaution && enIsCaution) ord++;
|
||||
if (note.IsNote && !enIsCaution) ord++;
|
||||
if (note.ItemID == srcItem.ItemID) return ord;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user