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) foreach (DataRow drt in dtt.Rows)
{ {
// get from/to seq, subtract off '0' to get stepnumber. // 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 fromStep = drt["FROMSEQUEN"].ToString()[1] - '0';
int toStep = drt["TOSEQUENCE"].ToString()[1] - '0'; int toStep = drt["TOSEQUENCE"].ToString()[1] - '0';
string foldSeq = drt["OLDTO"].ToString().Substring(0, 2); string foldSeq = drt["OLDTO"].ToString().Substring(0, 2);
for (int istp = fromStep; istp <= toStep; istp++) if (foldSeq[1] == 'F')
stpFoldSeq.Add(istp, foldSeq); {
for (int istp = fromStep; istp <= toStep; istp++)
stpFoldSeq.Add(istp, foldSeq);
}
} }
ds.Dispose(); ds.Dispose();
da.Dispose(); da.Dispose();
@ -385,12 +392,21 @@ namespace DataLoader
{ {
using (Item itmF = Item.Get(hlsItemId)) using (Item itmF = Item.Get(hlsItemId))
{ {
string fldstr = stpFoldSeq[cnt]; // be sure that the dictionaries contain the key.
int fldItemId = FoldoutStpSeq[fldstr]; // Some data may be 'corrupt' and not have the appropriate linkages
ConfigInfo ciFold = new ConfigInfo(itmF.MyContent.Config); // to floating foldouts.
ciFold.AddItem("Step", "FloatingFoldout", fldItemId.ToString()); if (stpFoldSeq.ContainsKey(cnt))
itmF.MyContent.Config = ciFold.ToString(); {
itmF.Save(); 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();
}
}
} }
} }
} }