This commit is contained in:
parent
84a519279d
commit
17476e9cdd
@ -132,6 +132,10 @@ namespace DataLoader
|
|||||||
if (dr2 != null)
|
if (dr2 != null)
|
||||||
{
|
{
|
||||||
string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString();
|
string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString();
|
||||||
|
// Range transitions that are type 2 are called 'and' transitions. These should extend to the
|
||||||
|
// last sibling. In data, these are represented with the SQL database field in the transitions
|
||||||
|
// table 'IsRange' == 2, and the toid == rangeid. In the content record, the link is
|
||||||
|
// TransitionRange:[type] [tranid] [toid] [rangeid] -> and the toid == rangeid
|
||||||
if (itype == 2)
|
if (itype == 2)
|
||||||
{
|
{
|
||||||
if (dr["TOSEQUENCE"].ToString().Length > 3 &&
|
if (dr["TOSEQUENCE"].ToString().Length > 3 &&
|
||||||
@ -165,26 +169,31 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
if (userid == null || userid == "") userid = "Migration";
|
if (userid == null || userid == "") userid = "Migration";
|
||||||
Transition tr = null;
|
Transition tr = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tr = Transition.New(fromCon, toItem, toItem2, itype, ci!=null?ci.ToString():null, dts, userid);
|
int isRange = 0;
|
||||||
//if (otranskey != null)
|
if (toItem.ItemID != toItem2.ItemID)
|
||||||
// tr.MyZTransition.Oldto = otranskey; // info to finish outside transition processing later
|
isRange = 1;
|
||||||
//else
|
else if (itype == 2)
|
||||||
tr.MyZTransition.Oldto = dr["OLDTO"].ToString();
|
isRange = 2;
|
||||||
|
tr = Transition.New(fromCon, toItem, toItem2, isRange, itype, ci != null ? ci.ToString() : null, dts, userid);
|
||||||
|
//if (otranskey != null)
|
||||||
|
// tr.MyZTransition.Oldto = otranskey; // info to finish outside transition processing later
|
||||||
|
//else
|
||||||
|
tr.MyZTransition.Oldto = dr["OLDTO"].ToString();
|
||||||
if (!tr.IsSavable) ErrorRpt.ErrorReport(tr);
|
if (!tr.IsSavable) ErrorRpt.ErrorReport(tr);
|
||||||
tr.Save();
|
tr.Save();
|
||||||
if (migrationErrors.Count > 0)
|
if (migrationErrors.Count > 0)
|
||||||
_ContentMigrationErrors.Add(fromCon.ContentID, migrationErrors);
|
_ContentMigrationErrors.Add(fromCon.ContentID, migrationErrors);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
frmMain.AddError(ex, "Error addition transition record");
|
frmMain.AddError(ex, "Error addition transition record");
|
||||||
log.Error("Error addition transition record");
|
log.Error("Error addition transition record");
|
||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
}
|
}
|
||||||
string results = null;
|
string results = null;
|
||||||
if (toItem.ItemID == toItem2.ItemID)
|
if (toItem.ItemID == toItem2.ItemID && itype != 2)
|
||||||
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:Transition:{0} {1} {2}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID);
|
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:Transition:{0} {1} {2}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID);
|
||||||
else
|
else
|
||||||
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:TransitionRange:{0} {1} {2} {3}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID, tr.RangeID);
|
results = string.Format(@"\v <START]\v0 (Resolved Transition Text)\v #Link:TransitionRange:{0} {1} {2} {3}[END>\v0 ", tr.TranType, tr.TransitionID, tr.ToID, tr.RangeID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user