Added code to support conversion to text of invalid referenced objects and invalid transitions

Added command line switch NOUPDATERO to prevent updating referenced objects
Added code to support conversion to text of invalid transitions
This commit is contained in:
Rich
2015-02-05 03:52:57 +00:00
parent af0e36b6c6
commit e3b5351b30
6 changed files with 370 additions and 21 deletions

View File

@@ -298,6 +298,7 @@ namespace VEPROMS.CSLA.Library
using (Item item = Get()) ItemInfo.Refresh(item);
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
tmp.UpdateTransitionText();
tmp.UpdateROText();
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
((ItemInfo)ActiveParent).MyContent.RefreshContentParts();
return tmp;
@@ -431,16 +432,16 @@ namespace VEPROMS.CSLA.Library
StepConfig sc = ii.MyConfig as StepConfig;
if (chgid != null && sc.Step_ChangeID != chgid)
{
sc.Step_ChangeID = chgid;
using (Item itm = ii.Get())
{
itm.MyContent.Config = sc.ToString();
itm.MyContent.DTS = DateTime.Now;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.Save();
}
sc.Step_ChangeID = chgid;
using (Item itm = ii.Get())
{
itm.MyContent.Config = sc.ToString();
itm.MyContent.DTS = DateTime.Now;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.Save();
}
}
}
// handle all of the children
if (ii.Cautions != null) foreach (ItemInfo chldc in ii.Cautions) PasteSetChangeId(chldc, chgid);
if (ii.Notes != null) foreach (ItemInfo chldn in ii.Notes) PasteSetChangeId(chldn, chgid);
@@ -490,6 +491,7 @@ namespace VEPROMS.CSLA.Library
ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, type, EAddpingPart.Before);
using (Item item = Get()) ItemInfo.Refresh(item);
tmp.UpdateTransitionText();
tmp.UpdateROText();
tmp.UpdatePastedStepTransitionText();
PasteSetChangeId(tmp, chgid);
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
@@ -518,6 +520,7 @@ namespace VEPROMS.CSLA.Library
// of any previous cautions or notes.
if (tmp.IsCaution || tmp.IsNote) ResetOrdinal();
tmp.UpdateTransitionText();
tmp.UpdateROText();
tmp.UpdatePastedStepTransitionText();
PasteSetChangeId(tmp, chgid);
OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After));
@@ -609,6 +612,7 @@ namespace VEPROMS.CSLA.Library
if (tmp.IsCaution || tmp.IsNote) ResetOrdinal();
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
tmp.UpdateTransitionText();
tmp.UpdateROText();
OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After));
return tmp;
}
@@ -675,7 +679,12 @@ namespace VEPROMS.CSLA.Library
oldContent = content;
}
if (oldContent == null) oldContent = content;
oldContent.FixTransitionText(tran);
//check to see if noneditable
bool forceConvertToText;
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
//SectionConfig sc = new SectionConfig(tran.MyItemToID.ActiveSection.MyConfig.ToString());
forceConvertToText = (sc.SubSection_Edit == "N");
oldContent.FixTransitionText(tran, forceConvertToText);
//if (content.IsDirty)
//{
// content.DTS = DateTime.Now;
@@ -710,7 +719,12 @@ namespace VEPROMS.CSLA.Library
{
using (Content content = tran.MyContent.Get())
{
content.FixTransitionText(tran);
//check to see if noneditable
bool forceConvertToText;
SectionConfig sc = tran.MyItemToID.ActiveSection.MyConfig as SectionConfig;
//SectionConfig sc = new SectionConfig(tran.MyItemToID.ActiveSection.MyConfig.ToString());
forceConvertToText = (sc.SubSection_Edit == "N");
content.FixTransitionText(tran, forceConvertToText);
if (content.IsDirty)
content.Save();
else // Update ContentInfo objects to reflect the change in the transition
@@ -737,6 +751,7 @@ namespace VEPROMS.CSLA.Library
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
tmp.UpdateTransitionText();
tmp.UpdateROText();
MyContent.RefreshContentParts();
OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child));
return tmp;
@@ -1301,6 +1316,7 @@ namespace VEPROMS.CSLA.Library
// of any previous cautions or notes.
if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal();
newItemInfo.UpdateTransitionText();
newItemInfo.UpdateROText();
newItemInfo.UpdatePastedStepTransitionText();
// Add to tree
if (newItemInfo.NextItemCount > 0)