|
|
|
@@ -1009,6 +1009,13 @@ namespace Volian.Controls.Library
|
|
|
|
|
mirs.Tag = ri;
|
|
|
|
|
mirs.Click += new EventHandler(MultiUnitSummaryOfChanges_Click);
|
|
|
|
|
}
|
|
|
|
|
if (ri.LatestVersion.ApprovedXML != null)
|
|
|
|
|
{
|
|
|
|
|
MenuItem miri = mir.MenuItems.Add("Create Procedure to Import");
|
|
|
|
|
miri.Tag = ri;
|
|
|
|
|
miri.Click += new EventHandler(ImportProcedure_Click);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//end added jcb 20111031
|
|
|
|
|
mv.Tag = lastApprovedRevisionID;
|
|
|
|
|
}
|
|
|
|
@@ -1059,7 +1066,7 @@ namespace Volian.Controls.Library
|
|
|
|
|
}
|
|
|
|
|
if (addImportMI && ri.LatestVersion.ApprovedXML != null)
|
|
|
|
|
{
|
|
|
|
|
MenuItem miri = mir.MenuItems.Add("Import Procedure");
|
|
|
|
|
MenuItem miri = mir.MenuItems.Add("Create Procedure to Import");
|
|
|
|
|
miri.Tag = ri;
|
|
|
|
|
miri.Click += new EventHandler(ImportProcedure_Click);
|
|
|
|
|
}
|
|
|
|
@@ -1073,7 +1080,12 @@ namespace Volian.Controls.Library
|
|
|
|
|
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);
|
|
|
|
|
string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database;
|
|
|
|
|
DirectoryInfo di = new DirectoryInfo(PEIPath);
|
|
|
|
|
if (!di.Exists) di.Create();
|
|
|
|
|
string fileName = PEIPath + "\\Approved_Rev_" + ri.RevisionNumber.Replace(" ","_") + "_" + xd.SelectSingleNode("procedure/content/@number").InnerText.Replace(" ","_").Replace(@"\u8209?", "-")+".pxml";
|
|
|
|
|
xd.Save(fileName);
|
|
|
|
|
MessageBox.Show("Approved procedure saved to import file " + fileName,"Saving TempMod", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ApprovedRevision_Click(object sender, EventArgs e)
|
|
|
|
@@ -1754,7 +1766,7 @@ namespace Volian.Controls.Library
|
|
|
|
|
ItemInfo.EAddpingPart pasteOpt = newtype == MenuSelections.StepBefore ? ItemInfo.EAddpingPart.Before : ItemInfo.EAddpingPart.After;
|
|
|
|
|
// If parent step is open in step editor, the 'OnPasteItemInfo' event will cause
|
|
|
|
|
// the item to be pasted in the step editor and the tree.
|
|
|
|
|
if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type)))
|
|
|
|
|
if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type)))
|
|
|
|
|
{
|
|
|
|
|
// The parent step was not open in the step editor, just paste step (in data) and add treenode.
|
|
|
|
|
// first, check if a changeid is required.
|
|
|
|
@@ -2112,7 +2124,7 @@ namespace Volian.Controls.Library
|
|
|
|
|
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
|
|
|
|
|
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString())
|
|
|
|
|
{
|
|
|
|
|
tn = new VETreeNode(_LastSectionInfo);
|
|
|
|
|
tn = new VETreeNode(_LastSectionInfo);
|
|
|
|
|
par.Nodes.Insert(indx, tn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -2165,18 +2177,18 @@ namespace Volian.Controls.Library
|
|
|
|
|
{
|
|
|
|
|
// If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel
|
|
|
|
|
ItemInfo ii = tn.VEObject as ItemInfo;
|
|
|
|
|
if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii, E_InsertType.Child, "New Step", 20002, E_FromType.Step)))
|
|
|
|
|
if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii, E_InsertType.Child, "New Step", 20002, E_FromType.Step)))
|
|
|
|
|
{
|
|
|
|
|
return null; // should we try to get to the child?
|
|
|
|
|
}
|
|
|
|
|
// The parent step was not open in the step editor, just create new step and add treenode.
|
|
|
|
|
using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step))
|
|
|
|
|
{
|
|
|
|
|
ShowBrokenRules(step.BrokenRulesCollection);
|
|
|
|
|
SetLastValues(StepInfo.Get(step.ItemID));
|
|
|
|
|
tn = new VETreeNode(_LastStepInfo);
|
|
|
|
|
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
|
|
|
|
|
}
|
|
|
|
|
// The parent step was not open in the step editor, just create new step and add treenode.
|
|
|
|
|
using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step))
|
|
|
|
|
{
|
|
|
|
|
ShowBrokenRules(step.BrokenRulesCollection);
|
|
|
|
|
SetLastValues(StepInfo.Get(step.ItemID));
|
|
|
|
|
tn = new VETreeNode(_LastStepInfo);
|
|
|
|
|
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
|
|
|
|
|
}
|
|
|
|
|
return tn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2184,24 +2196,24 @@ namespace Volian.Controls.Library
|
|
|
|
|
{
|
|
|
|
|
// If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel
|
|
|
|
|
ItemInfo ii = tn.VEObject as ItemInfo;
|
|
|
|
|
if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii,(newtype == MenuSelections.StepAfter) ? E_InsertType.After:E_InsertType.Before, "New Step")))
|
|
|
|
|
if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii, (newtype == MenuSelections.StepAfter) ? E_InsertType.After : E_InsertType.Before, "New Step")))
|
|
|
|
|
{
|
|
|
|
|
return (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
|
|
|
|
}
|
|
|
|
|
// The parent step was not open in the step editor, just create new step and add treenode.
|
|
|
|
|
int tvindex = SelectedNode.Index;
|
|
|
|
|
// if inserting before, the parent is set in case previous is null, i.e. beginning of the list.
|
|
|
|
|
ItemInfo parent = (newtype == MenuSelections.StepAfter) ? null : _LastStepInfo.MyParent;
|
|
|
|
|
using (Step step = Step.MakeStep(parent, (newtype == MenuSelections.StepAfter) ? _LastStepInfo : _LastStepInfo.MyPrevious, null, "New Step", (int)_LastStepInfo.MyContent.Type, (E_FromType)_LastStepInfo.FirstSibling.ItemParts[0].FromType))
|
|
|
|
|
{
|
|
|
|
|
ShowBrokenRules(step.BrokenRulesCollection);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
// The parent step was not open in the step editor, just create new step and add treenode.
|
|
|
|
|
int tvindex = SelectedNode.Index;
|
|
|
|
|
// if inserting before, the parent is set in case previous is null, i.e. beginning of the list.
|
|
|
|
|
ItemInfo parent = (newtype == MenuSelections.StepAfter) ? null : _LastStepInfo.MyParent;
|
|
|
|
|
using (Step step = Step.MakeStep(parent, (newtype == MenuSelections.StepAfter) ? _LastStepInfo : _LastStepInfo.MyPrevious, null, "New Step", (int)_LastStepInfo.MyContent.Type, (E_FromType)_LastStepInfo.FirstSibling.ItemParts[0].FromType))
|
|
|
|
|
{
|
|
|
|
|
ShowBrokenRules(step.BrokenRulesCollection);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
return tn;
|
|
|
|
|
}
|
|
|
|
|
private void ShowBrokenRules(BrokenRulesCollection brs)
|
|
|
|
|