Added code to support conversion to text of invalid referenced objects
Added code to support the searching for transitions Added code to support refreshing of referenced objects and transitions Added interface code to support refreshing of referenced objects and transitions Added code to store the xml representation of the approved version of the procedure in the database for future support of temp mods, etc.
This commit is contained in:
@@ -959,8 +959,12 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
MenuItem mir = mi.MenuItems.Add(ri.ToString());
|
||||
mir.Tag = ri;
|
||||
bool addImportMI = false;
|
||||
if (ri.LatestVersion.MyStage.IsApproved > 0 && (ri.RevisionID > lastApprovedRevisionID))
|
||||
{
|
||||
lastApprovedRevisionID = ri.RevisionID;
|
||||
addImportMI = true;
|
||||
}
|
||||
//mir.Click += new EventHandler(ApprovedRevision_Click);
|
||||
//added jcb 20111031
|
||||
if (ri.LatestVersion.PDF != null)
|
||||
@@ -975,11 +979,25 @@ namespace Volian.Controls.Library
|
||||
mirs.Tag = ri;
|
||||
mirs.Click += new EventHandler(SummaryOfChanges_Click);
|
||||
}
|
||||
if (addImportMI && ri.LatestVersion.ApprovedXML != null)
|
||||
{
|
||||
MenuItem miri = mir.MenuItems.Add("Import Procedure");
|
||||
miri.Tag = ri;
|
||||
miri.Click += new EventHandler(ImportProcedure_Click);
|
||||
}
|
||||
//end added jcb 20111031
|
||||
mi.Tag = lastApprovedRevisionID;
|
||||
}
|
||||
}
|
||||
|
||||
void ImportProcedure_Click(object sender, EventArgs e)
|
||||
{
|
||||
RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo;
|
||||
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
||||
xd.LoadXml(ri.LatestVersion.ApprovedXML);
|
||||
MessageBox.Show(xd.SelectSingleNode("procedure/content/@number").InnerText);
|
||||
}
|
||||
|
||||
void ApprovedRevision_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool superceded = false;
|
||||
@@ -1077,9 +1095,9 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
#region MenuPaste
|
||||
// Find what's in paste buffer & determine whether the paste can occur for the selected node.
|
||||
ItemInfo iiClipboard = OnClipboardStatus(this, new vlnTreeEventArgs(tn));
|
||||
if (iiClipboard != null)
|
||||
{
|
||||
ItemInfo iiClipboard = OnClipboardStatus(this,new vlnTreeEventArgs(tn));
|
||||
if(iiClipboard != null)
|
||||
{
|
||||
// can it be pasted at current node.
|
||||
if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc
|
||||
{
|
||||
@@ -1088,15 +1106,15 @@ namespace Volian.Controls.Library
|
||||
else
|
||||
{
|
||||
ItemInfo iiPasteHere = tn.VEObject as ItemInfo;
|
||||
if (iiPasteHere == null) return;
|
||||
bool okToReplace = iiClipboard.ItemID != iiPasteHere.ItemID;
|
||||
if (iiPasteHere == null) return;
|
||||
bool okToReplace = iiClipboard.ItemID != iiPasteHere.ItemID;
|
||||
if (iiPasteHere != null)
|
||||
{
|
||||
SectionInfo si = (tn.VEObject as SectionInfo != null) ? tn.VEObject as SectionInfo : null;
|
||||
if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after
|
||||
{
|
||||
cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click));
|
||||
cm.MenuItems.Add("Paste Procedure After", new EventHandler(mi_Click));
|
||||
}
|
||||
else if (iiPasteHere.IsProcedure && iiClipboard.IsSection) // procedure must have sections only
|
||||
@@ -1104,7 +1122,7 @@ namespace Volian.Controls.Library
|
||||
else if (iiPasteHere.IsSection && iiClipboard.IsSection)
|
||||
{
|
||||
cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||
cm.MenuItems.Add("Paste Section After", new EventHandler(mi_Click));
|
||||
if (si.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections && iiPasteHere.IsStepSection && iiClipboard.IsStepSection)
|
||||
{
|
||||
@@ -1119,7 +1137,7 @@ namespace Volian.Controls.Library
|
||||
else if (iiPasteHere.IsStep && iiClipboard.IsStep)
|
||||
{
|
||||
if (AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Step", new EventHandler(mi_Click));
|
||||
if (okToReplace) cm.MenuItems.Add("Replace Existing Step", new EventHandler(mi_Click));
|
||||
if (AddToInsertMenu(iiPasteHere, 1)) cm.MenuItems.Add("Paste Step After", new EventHandler(mi_Click));
|
||||
}
|
||||
}
|
||||
@@ -1496,8 +1514,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void tv_NodePaste(string p)
|
||||
{
|
||||
ItemInfo iiClipboard = OnClipboardStatus(this, null);
|
||||
if (iiClipboard == null) return;
|
||||
ItemInfo iiClipboard = OnClipboardStatus(this, null);
|
||||
if (iiClipboard == null) return;
|
||||
string message = string.Empty;
|
||||
if (iiClipboard.MyContent.MyEntry == null)
|
||||
{
|
||||
@@ -1539,23 +1557,23 @@ namespace Volian.Controls.Library
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
PasteAsDocVersionChild(tn, iiClipboard.ItemID);
|
||||
this.Cursor = Cursors.Default;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ItemInfo iiPaste = tn.VEObject as ItemInfo;
|
||||
if (iiPaste == null) return;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
if (p.IndexOf("Before") > -1)
|
||||
PasteBeforeOrAfter(MenuSelections.StepBefore, tn, iiClipboard.ItemID);
|
||||
else if (p.IndexOf("After") > -1)
|
||||
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
||||
else if (p.IndexOf("Replace") > -1)
|
||||
PasteReplace(tn, iiClipboard.ItemID);
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
if (p.IndexOf("Before") > -1)
|
||||
PasteBeforeOrAfter(MenuSelections.StepBefore, tn, iiClipboard.ItemID);
|
||||
else if (p.IndexOf("After") > -1)
|
||||
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
||||
else if (p.IndexOf("Replace") > -1)
|
||||
PasteReplace(tn, iiClipboard.ItemID);
|
||||
else // paste as child
|
||||
PasteAsChild(tn, iiClipboard.ItemID);
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void PasteAsDocVersionChild(VETreeNode tn, int copyStartID)
|
||||
{
|
||||
@@ -2054,6 +2072,7 @@ namespace Volian.Controls.Library
|
||||
SetLastValues(StepInfo.Get(step.ItemID));
|
||||
tn = new VETreeNode(_LastStepInfo);
|
||||
_LastStepInfo.UpdateTransitionText();
|
||||
_LastStepInfo.UpdateROText();
|
||||
TreeNode par = SelectedNode.Parent;
|
||||
par.Nodes.Insert(tvindex + ((newtype == MenuSelections.StepBefore) ? 0 : 1), tn);
|
||||
}
|
||||
|
Reference in New Issue
Block a user