This commit is contained in:
Kathy Ruffing 2013-05-14 12:48:08 +00:00
parent 85d0e02a4f
commit 63ebe985f1

View File

@ -371,11 +371,18 @@ namespace DataLoader
foreach (DataRow drt in dtt.Rows)
{
// get from/to seq, subtract off '0' to get stepnumber.
// The 'oldto' field stores which foldout section these steps go
// to. However, if reset, the 'oldto' may not contain a reference
// to a foldout, i.e. may contain 'junk' data. Only add the
// reference to the dictionary if it's a foldout.
int fromStep = drt["FROMSEQUEN"].ToString()[1] - '0';
int toStep = drt["TOSEQUENCE"].ToString()[1] - '0';
string foldSeq = drt["OLDTO"].ToString().Substring(0, 2);
for (int istp = fromStep; istp <= toStep; istp++)
stpFoldSeq.Add(istp, foldSeq);
if (foldSeq[1] == 'F')
{
for (int istp = fromStep; istp <= toStep; istp++)
stpFoldSeq.Add(istp, foldSeq);
}
}
ds.Dispose();
da.Dispose();
@ -385,12 +392,21 @@ namespace DataLoader
{
using (Item itmF = Item.Get(hlsItemId))
{
string fldstr = stpFoldSeq[cnt];
int fldItemId = FoldoutStpSeq[fldstr];
ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config);
ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString());
itmF.MyContent.Config = ciFold.ToString();
itmF.Save();
// be sure that the dictionaries contain the key.
// Some data may be 'corrupt' and not have the appropriate linkages
// to floating foldouts.
if (stpFoldSeq.ContainsKey(cnt))
{
string fldstr = stpFoldSeq[cnt];
if (FoldoutStpSeq.ContainsKey(fldstr))
{
int fldItemId = FoldoutStpSeq[fldstr];
ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config);
ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString());
itmF.MyContent.Config = ciFold.ToString();
itmF.Save();
}
}
}
}
}