Added logic to keep code from crashing when adding a non-step related transition.

Added a menu item to create an Import file from an approved procedure.
Converted PDF RO References to Uppercase so that the PDF Links to the complete RO Report would work.
Eliminated Unit ROs from ROCompleteReport references in the PDF Links
Convert RO Links to Uppercase to be consistent.
This commit is contained in:
Rich 2016-01-14 22:43:26 +00:00
parent 635d6fbdf2
commit 25dc39cd75
4 changed files with 50 additions and 33 deletions

View File

@ -62,7 +62,8 @@ namespace Volian.Controls.Library
_II_IncStepNumber=cbIncStepNum.Checked;
_II_Procedure=cbTranProcs.SelectedIndex;
_II_Section=cbTranSects.SelectedIndex;
_II_ItemID=(tvTran.SelectedNode.Tag as ItemInfo).ItemID;
if(tvTran.SelectedNode != null)
_II_ItemID=(tvTran.SelectedNode.Tag as ItemInfo).ItemID;
}
private bool SettingsChanged
{

View File

@ -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)

View File

@ -836,8 +836,8 @@ namespace Volian.Print.Library
PdfPCell cell = new PdfPCell();
if (MyROID != null)
{
chk.SetLocalDestination(string.Format("ROID={0}", MyROID)); // Destination
//Console.WriteLine("\"ROID\"\t\"{0}\"", MyROID);
chk.SetLocalDestination(string.Format("ROID={0}", MyROID.ToUpper())); // Destination
//Console.WriteLine("\"ROID\"\t\"{0}\"", MyROID.ToUpper());
MyROID = null;
}
p.Add(chk); // add the header chunk

View File

@ -957,8 +957,12 @@ namespace Volian.Print.Library
RoUsageInfo ru = MyItemInfo.MyContent.ContentRoUsages[0];
foreach (Chunk chk in IParagraph.Chunks)
{
chk.SetRemoteGoto("completeroreport.pdf", string.Format("ROID={0}", ru.ROID.Substring(0, 12)));
chk.SetBackground(new Color(System.Drawing.Color.LightGreen));
if (ru.ROID.Substring(0, 4) != "FFFF")
{
chk.SetRemoteGoto("completeroreport.pdf", string.Format("ROID={0}", ru.ROID.Substring(0, 12).ToUpper()));
//Console.WriteLine("ROID={0},{1}", ru.ROID.Substring(0, 12).ToUpper(), chk.Content);
chk.SetBackground(new Color(System.Drawing.Color.LightGreen));
}
}
}
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);