B2017-076 Added checks to see if we processed any transitions or ROs and added a status message at the end of importing explaining the procedure that was imported did not have transitions or ROs.
B2017-076 Added a Boolean return value to FixTransitionText so that we know if any transition was processed.
This commit is contained in:
@@ -223,6 +223,8 @@ namespace VEPROMS
|
||||
lblImportStatus.Text = "Performing Import";
|
||||
_DidConvertTransitionsToText = false;
|
||||
_DidConvertROsToText = false;
|
||||
_DidProcessTransitions = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
||||
_DidProcessROs = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
||||
//LoadImportDataReader();
|
||||
if (MyFolder != null) // import a folder - a .expx file
|
||||
{
|
||||
@@ -271,6 +273,10 @@ namespace VEPROMS
|
||||
string msg1 = (_DidConvertTransitionsToText && _DidConvertROsToText)?"Transitions and Referenced Objects":(_DidConvertTransitionsToText)?"Transitions":"Referenced Objects";
|
||||
msg += string.Format("\n\n{0} converted to text.\n\nThe locations can be found by doing a Global Search for the \"Link Converted To Text\" annotation type",msg1);
|
||||
}
|
||||
else if (!_DidProcessTransitions && !_DidProcessROs) // B2017-076 Approved import file does not have ROs nor Transitions
|
||||
{
|
||||
msg += "\n\nAll Transition and Referenced Object values are text.\n\nThere either were none or you had imported an Approved procedure.";
|
||||
}
|
||||
// B2016-225 added more information to the finish import message to tell the user when ROs or Transitions are converted to text.
|
||||
MessageBox.Show(msg, "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
//MessageBox.Show(string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
@@ -2640,6 +2646,8 @@ namespace VEPROMS
|
||||
// cc.Save();
|
||||
//}
|
||||
|
||||
private bool _DidProcessTransitions = false; // B2017-076 keep track whether we procrocessed Transitions
|
||||
|
||||
private void AddTransitions(Content content, XmlNode xn)
|
||||
{
|
||||
/*
|
||||
@@ -2690,7 +2698,7 @@ namespace VEPROMS
|
||||
content.Text = content.Text.Replace(lookfor, replacewith);
|
||||
if (content.MyGrid != null && content.MyGrid.Data != "")
|
||||
content.MyGrid.Data = content.MyGrid.Data.Replace(lookfor, replacewith);
|
||||
content.FixTransitionText(TransitionInfo.Get(tt.TransitionID));
|
||||
_DidProcessTransitions |= content.FixTransitionText(TransitionInfo.Get(tt.TransitionID)); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||
// B2017=003 make sure any grid changes are saved.
|
||||
// done here because FixTransitionText() could update the transitions in the grid
|
||||
if (content.MyGrid != null && content.MyGrid.Data != "")
|
||||
@@ -2708,6 +2716,7 @@ namespace VEPROMS
|
||||
{
|
||||
AddTransitions(PendingTransitions);
|
||||
}
|
||||
|
||||
private void AddTransitions(XmlDocument xd)
|
||||
{
|
||||
/*
|
||||
@@ -2769,7 +2778,7 @@ namespace VEPROMS
|
||||
SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
||||
forceConvertToText = (sc.SubSection_Edit == "N");
|
||||
}
|
||||
cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText);
|
||||
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||
// B2017=003 make sure any grid changes are saved.
|
||||
// done here because FixTransitionText() could update the transitions in the grid
|
||||
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
||||
@@ -2796,7 +2805,7 @@ namespace VEPROMS
|
||||
if (tt.TransitionID < 0)
|
||||
{
|
||||
forceConvertToText = true;
|
||||
cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText);
|
||||
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
}
|
||||
@@ -2831,14 +2840,14 @@ namespace VEPROMS
|
||||
// if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID)
|
||||
// forceConvertToText = true;
|
||||
//}
|
||||
cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText);
|
||||
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||
// B2017=003 make sure any grid changes are saved.
|
||||
// done here because FixTransitionText() could update the transitions in the grid
|
||||
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
||||
cc.MyGrid.Save();
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
_DidConvertTransitionsToText |= forceConvertToText; // B2016-225 - notify user when transitions are converted to text
|
||||
_DidConvertTransitionsToText |= (forceConvertToText && _DidProcessTransitions); // B2016-225 - notify user when transitions are converted to text
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3286,6 +3295,7 @@ namespace VEPROMS
|
||||
part3 = suffix.Replace(@"\v0", "") + part3.Substring(suffix.Length);
|
||||
content.Text = part1 + part2 + part3;
|
||||
ROToTextAnnotation(content, part2); // B2016-225 (follow through) add annotation when RO is converted to text
|
||||
_DidProcessROs = true; // B2017-076 flag that ROs where processed
|
||||
}
|
||||
lastIndex = mm.Index + mm.Length;
|
||||
}
|
||||
@@ -3332,6 +3342,7 @@ namespace VEPROMS
|
||||
//}
|
||||
_DidConvertROsToText |= true;
|
||||
}
|
||||
private bool _DidProcessROs = false; // B2017-076 flag that ROs where processed
|
||||
private void AddROUsages(Content content, XmlNode xn)
|
||||
{
|
||||
AddROUsages(content, xn, false);
|
||||
@@ -3339,6 +3350,7 @@ namespace VEPROMS
|
||||
// part of bug fix B2017-060 added the isGrid parameter
|
||||
private void AddROUsages(Content content, XmlNode xn, bool isGrid)
|
||||
{
|
||||
_DidProcessROs = false;
|
||||
if (_ConvertROsToTextDuringImport)
|
||||
ConvertImportProcedureROsToText(content, xn);
|
||||
else
|
||||
@@ -3359,6 +3371,7 @@ namespace VEPROMS
|
||||
RoUsageInfo roui = RoUsageInfo.Get(int.Parse(rousageid));
|
||||
content.FixContentText(roui, roval, 0, MyDocVersion.DocVersionAssociations[0].MyROFst, null, rousageid); // + " " + roid);
|
||||
_DidConvertROsToText |= true; // B2016-225 (follow through) add annotation when RO is converted to text
|
||||
_DidProcessROs = true; // B2017-076 flag that ROs where processed
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3367,6 +3380,7 @@ namespace VEPROMS
|
||||
RoUsageInfo roui = RoUsageInfo.Get(rou.ROUsageID);
|
||||
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
|
||||
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
|
||||
_DidProcessROs = content.Text.Contains(lookFor); // B2017-076 RO link in the text so we will be processing it
|
||||
if (lookFor != replaceWith)
|
||||
{
|
||||
content.Text = content.Text.Replace(lookFor, replaceWith);
|
||||
|
Reference in New Issue
Block a user