This commit is contained in:
Kathy Ruffing 2013-06-14 14:19:50 +00:00
parent ca50815d38
commit 1d6fb249c7

View File

@ -386,21 +386,24 @@ namespace DataLoader
} }
ds.Dispose(); ds.Dispose();
da.Dispose(); da.Dispose();
// now read in the HLS's and set their config to the appropriate foldout: // now read in the HLS's and set their config to the appropriate foldout.
int cnt = 1; // stpFoldSeq contains 16 bit step to foldout associations, i.e. an integer step
foreach (int hlsItemId in FloatingFoldoutHLS) // number (ordinal) and string sequence of foldout.
// FloatingFoldoutHLS contains each 16bit ordinal step number (all steps, whether
// they have a foldout or not) and the associated itemid in 32bit
// FoldoutStpSeq contains all foldouts, i.e. the string representing the sequence
// number if 16bit and the resulting 32bit itemid.
foreach (KeyValuePair<int, string> kvp in stpFoldSeq)
{ {
int hlsItemId = FloatingFoldoutHLS[kvp.Key-1]; // -1 for indexes starting at 0 (not 1)
using (Item itmF = Item.Get(hlsItemId)) using (Item itmF = Item.Get(hlsItemId))
{ {
// be sure that the dictionaries contain the key. // be sure that the dictionaries contain the key.
// Some data may be 'corrupt' and not have the appropriate linkages // Some data may be 'corrupt' and not have the appropriate linkages
// to floating foldouts. // to floating foldouts.
if (stpFoldSeq.ContainsKey(cnt)) if (FoldoutStpSeq.ContainsKey(kvp.Value))
{ {
string fldstr = stpFoldSeq[cnt]; int fldItemId = FoldoutStpSeq[kvp.Value];
if (FoldoutStpSeq.ContainsKey(fldstr))
{
int fldItemId = FoldoutStpSeq[fldstr];
ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config); ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config);
ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString()); ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString());
itmF.MyContent.Config = ciFold.ToString(); itmF.MyContent.Config = ciFold.ToString();
@ -409,7 +412,6 @@ namespace DataLoader
} }
} }
} }
}
catch (Exception ex) catch (Exception ex)
{ {
frmMain.AddError(ex, "Error resolving Floating Foldout Data '{0}'", ProcNumber); frmMain.AddError(ex, "Error resolving Floating Foldout Data '{0}'", ProcNumber);