Compare commits

...

26 Commits

Author SHA1 Message Date
jjenko 43b13443ab Merge pull request 'C2024-027 RO Editor – Add additional feature to allow Cut/Paste (Moving) a RO within the same table.' (#437) from CSM-C2024-027 into Development
Good for testing phase
2024-10-23 13:38:10 -04:00
mschill c867d4e4b1 C2024-027 RO Editor – Add additional feature to allow Cut/Paste (Moving) a RO within the same table. 2024-10-23 13:20:20 -04:00
jjenko 0f541142cc Merge pull request 'F2024-081- Removed the extra blank line after the Alternate High Level Step type. This was mistakenly changed during format cleanup. It is now restored to what it should be.' (#436) from F2024-081_Catawba into Development
Format only changes.
2024-10-23 12:01:19 -04:00
jjenko b0c55d09b0 F2024-081- Removed the extra blank line after the Alternate High Level Step type. This was mistakenly changed during format cleanup. It is now restored to what it should be. 2024-10-23 11:59:55 -04:00
jjenko ee71431210 Merge pull request 'F2024-076 - Added a line before the continue message in the background formats. Centered the bottom continue message for the step editor sections – all formats' (#435) from F2024-076_BV_ContinueMsg into Development
format only changes
2024-10-23 11:08:00 -04:00
jjenko a8196db676 F2024-076 - Added a line before the continue message in the background formats. Centered the bottom continue message for the step editor sections – all formats 2024-10-23 11:06:31 -04:00
jjenko 8dc78d49eb Merge pull request 'Delete .gitattributes' (#434) from remove_gitattributes into Development
changes are good. This should allow us to compare format files again.
2024-10-17 09:27:10 -04:00
jjenko 3999d1c49b Merge pull request 'C2020-049-Add-the-ability-for-PROMS-to-remember-open-procedure-tabs-fixed-print' (#433) from C2020-049-Add-the-ability-for-PROMS-to-remember-open-procedure-tabs-fixed-print into Development
good for testing phase
2024-10-17 09:25:22 -04:00
mschill aceb928dba Delete .gitattributes
remove gitattributes file
2024-10-17 09:17:01 -04:00
plarsen f17db695d3 C2020-049-Add-the-ability-for-PROMS-to-remember-open-procedure-tabs-fixed-print 2024-10-16 16:23:31 -04:00
jjenko 214dd8ec08 Merge pull request 'GIT_ATTRIBUTE_FILE - adjusting GIT settings so should be able to see diff of xml files in GIT (and not just Visual Studio history)' (#432) from GIT_ATTRIBUTE_FILE2 into Development
change approved - no testing needed for this.
2024-10-15 09:23:27 -04:00
jjenko 2f974d7b52 Merge pull request 'C2024-029 RO Editor - Referenced Object Definition Form - Add check if items changed before prompting to possibly save' (#431) from C2024-029 into Development
good for testing phase
2024-10-15 09:22:16 -04:00
mschill 9f1dce896f GIT_ATTRIBUTE_FILE - adjusting GIT settings so should be able to see diff of xml files in GIT (and not just Visual Studio history) 2024-10-15 08:58:15 -04:00
mschill a8294bb01a C2024-029 RO Editor - Referenced Object Definition Form - Add check if items changed before prompting to possibly save 2024-10-15 08:40:12 -04:00
jjenko 28e4bdda29 Merge pull request 'B2024-079 Consistency of adding_editing_removing fields in RO Editor - Referenced Object Definition Form' (#430) from B2024-079 into Development
change are good.  Ready for testing phase.
2024-10-14 16:36:39 -04:00
mschill 7d408df904 B2024-079 Consistency of adding_editing_removing fields in RO Editor - Referenced Object Definition Form 2024-10-14 16:17:19 -04:00
jjenko caec6adf8d Merge pull request 'F2024-075 (Farley) Action verbs should be bolded no matter if title case or lower case - all formats' (#429) from F2024-075_FarlyRplWrds into Development
Format only change. OK to test.
2024-10-14 14:08:11 -04:00
jjenko a38c0dbe33 F2024-075 (Farley) Action verbs should be bolded no matter if title case or lower case - all formats 2024-10-14 14:06:17 -04:00
jjenko d779d4ad50 Merge pull request 'GIT_ATTRIBUTE_FILE - adjusting GIT settings so should be able to see diff of xml files in GIT (and not just Visual Studio' (#428) from GIT_ATRIBUTE_FILE into Development
No testing needed.  This is just a Git configuration setting for the developers.
2024-10-10 16:30:22 -04:00
mschill 9b71ce0fee GIT_ATTRIBUTE_FILE - adjusting GIT settings so should be able to see diff of xml files in GIT (and not just Visual Studio 2024-10-10 15:51:11 -04:00
jjenko 8b18005b8e Merge pull request 'B2024-078 Bad Transition preventing editing of a substep. Can enter changed text, but then when move to another textbox, original text returns.' (#427) from B2024-078 into Development
changes good for testing phase.
2024-10-10 08:57:54 -04:00
mschill a550ef1b50 B2024-078 Bad Transition preventing editing of a substep. Can enter changed text, but then when move to another textbox, original text returns. 2024-10-10 08:38:35 -04:00
jjenko 63a60b32cc Merge pull request 'F2024-074 For Farley, Include the Cover Page in the total page count of the procedures' (#426) from F2024_074_FNP_CountCoverWithProcs into Development
format only change
2024-10-09 16:47:48 -04:00
jjenko ca4dc8d330 F2024-074 For Farley, Include the Cover Page in the total page count of the procedures 2024-10-09 16:45:38 -04:00
jjenko 0a52aa5c53 Merge pull request 'C2024-024 Simple Selection of Fields to add to Return Values and Menu Values' (#423) from C2024-024 into Development
file changes look good - ready for testing phase.
2024-10-09 14:02:53 -04:00
mschill 591fc03ca2 C2024-024 Simple Selection of Fields to add to Return Values and Menu Values 2024-10-09 13:12:29 -04:00
27 changed files with 925 additions and 421 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -23,8 +23,8 @@ using System.Runtime.CompilerServices;
// Build YYMM (two digit year, two digit month)
// Revision DHH (day - no leading zero, two digit hour - military time
//
[assembly: AssemblyVersion("2.3.2404.1611")]
[assembly: AssemblyFileVersion("2.3.2404.1611")]
[assembly: AssemblyVersion("2.3.2410.907")]
[assembly: AssemblyFileVersion("2.3.2410.907")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
@@ -91,6 +91,8 @@ using System.Runtime.CompilerServices;
@@ -344,6 +344,9 @@ namespace ROEditor
lboxAvail.GotFocus += new EventHandler(this.lboxAvail_GotFocus);
lboxInUse.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lboxInUse_MouseUp);
lboxInUseCB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lboxInUseCB_MouseUp);
// save copies of local data, so if there is a change, we know we must save them.
origRetVal = this.tbRetVal.Text;
origMenuItem = this.tbMenuVal.Text;
@@ -385,6 +388,103 @@ namespace ROEditor
this.btnRemove.Enabled = false;
this.btnEdit.Enabled = true;
}
//CSM C2024-024
//Simple Selection of Fields to add to Return Values and Menu Values.
//Part of 2024 PROMS Upgrades
//Add Context Menu for In Use Listbox
//Will allow user to right click Selected Items
//and add then to the Return Value / Menu Value Text Boxes
//without re-typing them
protected void lboxInUse_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right && lboxInUse.SelectedItems.Count > 0)
{
ContextMenuStrip cn = new ContextMenuStrip();
if (tbRetVal.Visible)
{
var AddToReturnItem = new ToolStripMenuItem("Add to Return Value");
AddToReturnItem.Click += new EventHandler(lboxInUse_Click);
AddToReturnItem.Name = "Add to Return Value";
cn.Items.Add(AddToReturnItem);
}
var AddToMenuItem = new ToolStripMenuItem("Add to Menu Value");
AddToMenuItem.Click += new EventHandler(lboxInUse_Click);
AddToMenuItem.Name = "Add to Menu Value";
cn.Items.Add(AddToMenuItem);
this.lboxInUse.ContextMenuStrip = cn;
cn.Show(Control.MousePosition.X, Control.MousePosition.Y);
}
}
private void lboxInUse_Click(object sender, EventArgs e)
{
switch (((ToolStripMenuItem)sender).Name)
{
case "Add to Return Value":
if (tbRetVal.Text == "")
tbRetVal.Text += $"<{lboxInUse.SelectedItem}>";
else
tbRetVal.Text += $" - <{lboxInUse.SelectedItem}>";
break;
case "Add to Menu Value":
if (tbMenuVal.Text == "")
tbMenuVal.Text += $"<{lboxInUse.SelectedItem}>";
else
tbMenuVal.Text += $" - <{lboxInUse.SelectedItem}>";
break;
}
}
//CSM C2024-024
//Simple Selection of Fields to add to Return Values and Menu Values.
//Part of 2024 PROMS Upgrades
//Add Context Menu for In Use ComboBox
//(Replaces In Use Listbox when Applicability
//to allow for selection of items per Unit)
//Will allow user to right click Selected Items
//and add then to the Return Value / Menu Value Text Boxes
//without re-typing them
protected void lboxInUseCB_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right && lboxInUseCB.SelectedItems.Count > 0)
{
ContextMenuStrip cn = new ContextMenuStrip();
if (tbRetVal.Visible)
{
var AddToReturnItem = new ToolStripMenuItem("Add to Return Value");
AddToReturnItem.Click += new EventHandler(lboxInUseCB_Click);
AddToReturnItem.Name = "Add to Return Value";
cn.Items.Add(AddToReturnItem);
}
var AddToMenuItem = new ToolStripMenuItem("Add to Menu Value");
AddToMenuItem.Click += new EventHandler(lboxInUseCB_Click);
AddToMenuItem.Name = "Add to Menu Value";
cn.Items.Add(AddToMenuItem);
this.lboxInUseCB.ContextMenuStrip = cn;
cn.Show(Control.MousePosition.X, Control.MousePosition.Y);
}
}
private void lboxInUseCB_Click(object sender, EventArgs e)
{
switch (((ToolStripMenuItem)sender).Name)
{
case "Add to Return Value":
if (tbRetVal.Text == "")
tbRetVal.Text += $"<{lboxInUseCB.SelectedItem}>";
else
tbRetVal.Text += $" - <{lboxInUseCB.SelectedItem}>";
break;
case "Add to Menu Value":
if (tbMenuVal.Text == "")
tbMenuVal.Text += $"<{lboxInUseCB.SelectedItem}>";
else
tbMenuVal.Text += $" - <{lboxInUseCB.SelectedItem}>";
break;
}
}
private void btnRemove_Click(object sender, System.EventArgs e)
{
//get item in lboxInUse (in use list) and remove it from there
@@ -404,7 +504,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
AvailList.Add(copyrof);
lboxAvail.Items.Add(copyrof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
InUseList.RemoveAt(indx);
if (InUseApplcList.Contains(rof)) // C2021-026 remove from the field applicability list
InUseApplcList.Remove(rof);
@@ -427,7 +527,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
AvailList.Add(copyrof);
lboxAvail.Items.Add(copyrof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
InUseList.RemoveAt(indx);
if (InUseApplcList.Contains(rof)) // C2021-026 remove from the field applicability list
InUseApplcList.Remove(rof);
@@ -455,7 +555,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
InUseList.Add(copyrof);
lboxInUseCB.Items.Add(copyrof.GetFieldname);
lboxInUseCB.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
AvailList.RemoveAt(indx);
lboxAvail.Refresh();
lboxInUseCB.Refresh();
@@ -477,7 +577,7 @@ namespace ROEditor
ROField copyrof = new ROField(rof.GetFieldname, rof.GetRecID, rof.GetMasterRecID, rof.GetFieldType);
InUseList.Add(copyrof);
lboxInUse.Items.Add(copyrof.GetFieldname);
lboxInUse.Items.Add(CvtFldToUserFld(copyrof.GetFieldname));
AvailList.RemoveAt(indx);
lboxAvail.Refresh();
lboxInUse.Refresh();
@@ -640,7 +740,7 @@ namespace ROEditor
{
ROField rof = (ROField) InUseList[i];
rofname = rof.GetFieldname;
if (inusename == rofname)
if (inusename == rofname || inusename == CvtFldToUserFld(rofname))
{
found = true;
break;
@@ -745,7 +845,7 @@ namespace ROEditor
{
ROField rof = (ROField) InUseList[i];
rofname = rof.GetFieldname;
if (inusename == rofname)
if (inusename == rofname || inusename == CvtFldToUserFld(rofname))
{
found = true;
break;
@@ -1097,6 +1197,7 @@ namespace ROEditor
}
}
string origname = CvtFldToUserFld(rof.GetFieldname);
uint ftype = rof.GetFieldType;
if (ftype == (uint)FieldTypes.FrmtSingleTxt || ftype == (uint)FieldTypes.VariableTxt ||
ftype == (uint)FieldTypes.SingleTxt || ftype == (uint)FieldTypes.Table ||
@@ -1112,6 +1213,10 @@ namespace ROEditor
nwcomb.ShowDialog();
}
//need to refresh pull from table for fields in use.
_ = myrodb.RODB_GetFields(elem, 0, true);
string newname = CvtFldToUserFld(rof.GetFieldname);
// Update Lists & Text boxes to represent any modified text.
if (isInSelList)
{
@@ -1125,20 +1230,28 @@ namespace ROEditor
rof = (ROField) InUseList[i];
if (rof.GetFieldname != null)
{
string fieldname = CvtFldToUserFld(rof.GetFieldname);
// C2021-026 if doing Parent/Child enabled RO Editor, put the In Use fields in the Check Box List instead of the normal list
if (PCApplicabilityEnabled)
{
this.lboxInUseCB.Items.Add(rof.GetFieldname);
this.lboxInUseCB.Items.Add(fieldname);
if (rof.FieldTypeCanDoApplicability())
{
if (ContainedInUseApplicList(rof))
this.lboxInUseCB.SetItemCheckState(lboxInUseCB.Items.IndexOf(rof.GetFieldname), CheckState.Checked);
this.lboxInUseCB.SetItemCheckState(lboxInUseCB.Items.IndexOf(fieldname), CheckState.Checked);
}
}
else
this.lboxInUse.Items.Add(rof.GetFieldname);
this.lboxInUse.Items.Add(fieldname);
}
}
if (origname != newname)
{
tbMenuVal.Text = tbMenuVal.Text.Replace($"<{origname}>", $"<{newname}>");
tbRetVal.Text = tbRetVal.Text.Replace($"<{origname}>", $"<{newname}>");
}
}
else
{
@@ -1148,7 +1261,7 @@ namespace ROEditor
{
rof = (ROField) AvailList[i];
if (rof.GetFieldname != null)
this.lboxAvail.Items.Add(rof.GetFieldname);
this.lboxAvail.Items.Add(CvtFldToUserFld(rof.GetFieldname));
}
}
}
@@ -1162,8 +1275,11 @@ namespace ROEditor
if (rof.GetFieldname != null)
{
AvailList.Add(rof);
lboxAvail.Items.Add(rof.GetFieldname);
lboxAvail.Items.Add(CvtFldToUserFld(rof.GetFieldname));
}
//need to refresh pull from table for fields in use.
_ = myrodb.RODB_GetFields(elem, 0, true);
}
// C2021-026 Check/un-check field for Parent/Child values
private void lboxInUseCB_ItemCheck(object sender, ItemCheckEventArgs e)
@@ -1397,6 +1513,7 @@ namespace ROEditor
this.btnCancel.Size = new System.Drawing.Size(80, 24);
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "Cancel";
//
// RODefFrm
//
@@ -1419,6 +1536,71 @@ namespace ROEditor
this.PerformLayout();
}
//if User clicked save (DialogResult.OK) close the form
//if use did not click save, ask if they are sure they want to close the form
//only close if they say "Yes, they want to"
protected override void OnFormClosing(FormClosingEventArgs e)
{
if (this.DialogResult != System.Windows.Forms.DialogResult.OK && IsPendingChange() && !CloseCancel())
{
e.Cancel = true;
}
}
public static bool CloseCancel()
{
const string message = "Are you sure that you would like to cancel? Information may not be saved.";
const string caption = "Cancel";
var result = MessageBox.Show(message, caption,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
return result == DialogResult.Yes;
}
//return true if a field has been modified
private bool IsPendingChange()
{
if (origRetVal != this.tbRetVal.Text)
return true;
if (origMenuItem != this.tbMenuVal.Text)
return true;
// check if in use records have changed
string inuserecs = null;
ROField rof;
for (int i = 0; i < InUseList.Count; i++)
{
rof = (ROField)InUseList[i];
if (rof.GetFieldname != null) //DO YET: why null?
{
inuserecs = inuserecs + rof.GetRecID;
if (i + 1 < InUseList.Count) inuserecs = inuserecs + " ";
}
}
if (inuserecs != origFieldsInUse)
return true;
//check if applicability fields have changed
string applicfieldrecs = null;
for (int i = 0; i < InUseApplcList.Count; i++)
{
rof = (ROField)InUseApplcList[i];
if (rof.GetFieldname != null)
{
applicfieldrecs = applicfieldrecs + rof.GetRecID;
if (i + 1 < InUseApplcList.Count) applicfieldrecs = applicfieldrecs + " ";
}
}
if (applicfieldrecs != origApplicFields)
return true;
//nothing has changed
return false;
}
#endregion
}
}
@@ -300,6 +300,8 @@ using RODBInterface;
using ROFields;
using Org.Mentalis.Files;
using System.Runtime.InteropServices;
using System.Linq;
using System.Collections.Generic;
//using IniFileIO;
@@ -334,6 +336,8 @@ namespace ROEditor
private System.Windows.Forms.MenuItem menuRONew;
private System.Windows.Forms.MenuItem menuNewRefObj;
private System.Windows.Forms.MenuItem menuROEdit;
private System.Windows.Forms.MenuItem menuROCut;
private System.Windows.Forms.MenuItem menuROPaste;
private System.Windows.Forms.MenuItem menuRODelete;
private System.Windows.Forms.MenuItem menuROSave;
private System.Windows.Forms.MenuItem menuROProperties;
@@ -357,6 +361,10 @@ namespace ROEditor
get { return _CurrentTextBox; }
set { _CurrentTextBox = value; }
}
public List<TreeNode> ROsSelectedforMultiMove { get; set; } //to allow multiple RO nodes to be selected
public bool ROCutWasSelected { get; set; } = false;
private VlnXmlElement rootXml;
private TreeNode rootNode;
@@ -379,6 +387,7 @@ namespace ROEditor
private const int ROGROUPIMAGE = 0;
private System.Windows.Forms.Panel panel2;
private const int ROIMAGE = 1;
private Color MULTISELECTCOLOR = Color.LightGreen; //back color that multiselected ROs will show
private ToolBarButton tbtnSave;
private ToolBarButton tbtnRestore;
@@ -405,13 +414,15 @@ namespace ROEditor
DbConnectPath = PassedInPath;
// Setup the context menu
MenuItem[] ContextMenuItemList = new MenuItem[6];
MenuItem[] ContextMenuItemList = new MenuItem[8];
ContextMenuItemList[0] = new MenuItem("Expand/Collaspe",new EventHandler(roTreeView_ToggleExpandCollapse));
ContextMenuItemList[1] = menuRONew.CloneMenu();
ContextMenuItemList[2] = menuROEdit.CloneMenu();
ContextMenuItemList[3] = menuRODelete.CloneMenu();
ContextMenuItemList[4] = menuROSave.CloneMenu();
ContextMenuItemList[5] = menuROProperties.CloneMenu();
ContextMenuItemList[3] = menuROCut.CloneMenu();
ContextMenuItemList[4] = menuROPaste.CloneMenu();
ContextMenuItemList[5] = menuRODelete.CloneMenu();
ContextMenuItemList[6] = menuROSave.CloneMenu();
ContextMenuItemList[7] = menuROProperties.CloneMenu();
ContextMenu treePopupMenu = new ContextMenu(ContextMenuItemList);
@@ -589,6 +600,8 @@ namespace ROEditor
protected void roTreeView_AfterSelect (object sender,
System.Windows.Forms.TreeViewEventArgs e)
{
TreeNode PreviousNode = LastSelectedNode;
// if the same node was selected, don't do anything.
if (LastSelectedNode != null && LastSelectedNode.Equals(roTreeView.SelectedNode)) return;
@@ -622,7 +635,7 @@ namespace ROEditor
// Enable the Save item if changes were made
// Just copy the state of the Save Button
menuROSave.Enabled = tbtnSave.Enabled;
roTreeView.ContextMenu.MenuItems[4].Enabled = tbtnSave.Enabled;
roTreeView.ContextMenu.MenuItems[6].Enabled = tbtnSave.Enabled;
// Should the properties menu item be available?
VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag;
@@ -651,8 +664,81 @@ namespace ROEditor
EditRO(curelem);
else
updateRoListView(CurrentNode);
//cut is only enabled on RO Values
menuROCut.Enabled = roTreeView_IsSubgroupOrRO() && curelem.Name != "vlnGroup";
roTreeView.ContextMenu.MenuItems[3].Enabled = menuROCut.Enabled;
//paste is only enabled on subgroups and only once Cut has been selected
menuROPaste.Enabled = roTreeView_IsSubgroupOrRO() && curelem.Name == "vlnGroup" && ROCutWasSelected && (ROsSelectedforMultiMove.Count > 0);
roTreeView.ContextMenu.MenuItems[4].Enabled = menuROPaste.Enabled;
//code to allow selection of multiple nodes for Move
//if Ctrl/Shift Key is held down
if (ROsSelectedforMultiMove == null)
ROsSelectedforMultiMove = new List<TreeNode>();
if ((Control.ModifierKeys & Keys.Shift) != 0)
{
//if shift is held down, clear existing nodes then add the range of nodes
roTreeView_ClearAllMultiSelect();
if (PreviousNode.Index < CurrentNode.Index)
{
//Traverse Down
TreeNode nodeIter = PreviousNode;
do
{
VlnXmlElement curelemforNodeIter = (VlnXmlElement)nodeIter.Tag;
if (curelemforNodeIter.Name != "RO_Root" && curelemforNodeIter.Name != "vlnGroup")
{
nodeIter.BackColor = MULTISELECTCOLOR;
ROsSelectedforMultiMove.Add(nodeIter);
}
}
while (nodeIter != CurrentNode && (nodeIter = nodeIter.NextNode) != null);
}
else
{
//Traverse Up
TreeNode nodeIter = PreviousNode;
do
{
VlnXmlElement curelemforNodeIter = (VlnXmlElement)nodeIter.Tag;
if (curelemforNodeIter.Name != "RO_Root" && curelemforNodeIter.Name != "vlnGroup")
{
nodeIter.BackColor = MULTISELECTCOLOR;
ROsSelectedforMultiMove.Add(nodeIter);
}
}
while (nodeIter != CurrentNode && (nodeIter = nodeIter.PrevNode) != null);
}
}
else
{
//deselect all currently selected if ctrl key not held down,
//add the current item that is clicked
//ignoring if a group or subgroup is clicked
if (curelem.Name != "RO_Root" && curelem.Name != "vlnGroup")
{
if ((Control.ModifierKeys & Keys.Control) == 0)
roTreeView_ClearAllMultiSelect();
roTreeView.SelectedNode.BackColor = MULTISELECTCOLOR;
ROsSelectedforMultiMove.Add(roTreeView.SelectedNode);
}
}
}
}
//clear all multiselected items
protected void roTreeView_ClearAllMultiSelect()
{
foreach (TreeNode tn in ROsSelectedforMultiMove)
tn.BackColor = Color.White;
ROsSelectedforMultiMove.Clear();
}
private string CvtUserFldToFld(string fldname)
{
@@ -783,25 +869,25 @@ namespace ROEditor
// Should the save option be available?
// Just reflect the Save button state.
roTreeView.ContextMenu.MenuItems[4].Enabled = tbtnSave.Enabled;
roTreeView.ContextMenu.MenuItems[6].Enabled = tbtnSave.Enabled;
menuROSave.Enabled = tbtnSave.Enabled;
// Should the properties menu item be available?
VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag;
if (curelem.Name == "vlnGroup")
roTreeView.ContextMenu.MenuItems[5].Enabled = true;
roTreeView.ContextMenu.MenuItems[7].Enabled = true;
else
roTreeView.ContextMenu.MenuItems[5].Enabled = false;
roTreeView.ContextMenu.MenuItems[7].Enabled = false;
// should delete menu item be available, i.e. top node NO!
if (curelem.Name == "RO_Root")
{
roTreeView.ContextMenu.MenuItems[3].Enabled = false;
roTreeView.ContextMenu.MenuItems[5].Enabled = false;
roTreeView.ContextMenu.MenuItems[1].MenuItems[1].Enabled = false;
}
else
{
roTreeView.ContextMenu.MenuItems[3].Enabled = true;
roTreeView.ContextMenu.MenuItems[5].Enabled = true;
roTreeView.ContextMenu.MenuItems[1].MenuItems[1].Enabled = true;
}
@@ -1146,6 +1232,7 @@ namespace ROEditor
{
chldnd = new TreeNode(TheMenuTitle,ROIMAGE,ROIMAGE);
chldnd.Tag = echild;
chldnd.Name = echild.GetAttribute("RecID");
enode.Nodes.Add(chldnd);
}
}
@@ -1195,6 +1282,8 @@ namespace ROEditor
this.menuNewRefObj = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuROEdit = new System.Windows.Forms.MenuItem();
this.menuROCut = new System.Windows.Forms.MenuItem();
this.menuROPaste = new System.Windows.Forms.MenuItem();
this.menuRODelete = new System.Windows.Forms.MenuItem();
this.menuROSave = new System.Windows.Forms.MenuItem();
this.menuROProperties = new System.Windows.Forms.MenuItem();
@@ -1260,6 +1349,8 @@ namespace ROEditor
this.menuRONew,
this.menuItem1,
this.menuROEdit,
this.menuROCut,
this.menuROPaste,
this.menuRODelete,
this.menuROSave,
this.menuROProperties,
@@ -1298,34 +1389,48 @@ namespace ROEditor
this.menuROEdit.Index = 2;
this.menuROEdit.Text = "Edit";
this.menuROEdit.Click += new System.EventHandler(this.menuROEdit_Click);
//
// menuROCut
//
this.menuROCut.Enabled = false;
this.menuROCut.Index = 3;
this.menuROCut.Text = "Cut (Move RO)";
this.menuROCut.Click += new System.EventHandler(this.menuROCut_Click);
//
// menuROPaste
//
this.menuROPaste.Enabled = false;
this.menuROPaste.Index = 4;
this.menuROPaste.Text = "Paste (Move RO)";
this.menuROPaste.Click += new System.EventHandler(this.menuROPaste_Click);
//
// menuRODelete
//
this.menuRODelete.Index = 3;
this.menuRODelete.Index = 5;
this.menuRODelete.Text = "Delete";
this.menuRODelete.Click += new System.EventHandler(this.menuRODelete_Click);
//
// menuROSave
//
this.menuROSave.Enabled = false;
this.menuROSave.Index = 4;
this.menuROSave.Index = 6;
this.menuROSave.Text = "Save";
this.menuROSave.Click += new System.EventHandler(this.menuROSave_Click);
//
// menuROProperties
//
this.menuROProperties.Index = 5;
this.menuROProperties.Index = 7;
this.menuROProperties.Text = "Properties";
this.menuROProperties.Click += new System.EventHandler(this.menuROProperties_Click);
//
// menuItem10
//
this.menuItem10.Index = 6;
this.menuItem10.Index = 8;
this.menuItem10.Text = "-";
//
// menuROExit
//
this.menuROExit.Index = 7;
this.menuROExit.Index = 9;
this.menuROExit.Text = "Exit RO Editor";
this.menuROExit.Click += new System.EventHandler(this.menuROExit_Click);
//
@@ -1434,7 +1539,7 @@ namespace ROEditor
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(228, 28);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(710, 591);
this.panel1.Size = new System.Drawing.Size(752, 591);
this.panel1.TabIndex = 5;
//
// panel2
@@ -1475,7 +1580,7 @@ namespace ROEditor
this.tbar.Location = new System.Drawing.Point(0, 0);
this.tbar.Name = "tbar";
this.tbar.ShowToolTips = true;
this.tbar.Size = new System.Drawing.Size(938, 28);
this.tbar.Size = new System.Drawing.Size(980, 28);
this.tbar.TabIndex = 0;
this.tbar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
this.tbar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbar_OnClick);
@@ -1537,7 +1642,7 @@ namespace ROEditor
//
this.lblDuplicateRO.AutoSize = true;
this.lblDuplicateRO.ForeColor = System.Drawing.Color.Red;
this.lblDuplicateRO.Location = new System.Drawing.Point(491, 9);
this.lblDuplicateRO.Location = new System.Drawing.Point(570, 9);
this.lblDuplicateRO.Name = "lblDuplicateRO";
this.lblDuplicateRO.Size = new System.Drawing.Size(139, 13);
this.lblDuplicateRO.TabIndex = 6;
@@ -1561,6 +1666,173 @@ namespace ROEditor
this.ResumeLayout(false);
this.PerformLayout();
}
//Cut/Paste (Move ROs) added as part of CSM-C2024-027 / Part of 2024 PROMS Upgrades
private void menuROCut_Click(object sender, EventArgs e)
{
ROCutWasSelected = true;
string msgstr = "It is recommended that after moving ROs, you create a FST an use it to update RO Values in PROMS to ensure RO Links properly move to the new location as well.\n\n Are you sure you wish to move the RO(s)?";
DialogResult AnswerYN = MessageBox.Show(msgstr, "RO Editor", MessageBoxButtons.YesNo);
if (AnswerYN != DialogResult.Yes)
ROCutWasSelected = false;
}
//part of CSM-C2024-027 / Part of 2024 PROMS Upgrades
//Paste Selected - will move individual ROs
private void menuROPaste_Click(object sender, EventArgs e)
{
if (ROCutWasSelected && ROsSelectedforMultiMove.Count == 0)
{
MessageBox.Show("Cut must be selected before able to Paste/Move a RO");
return;
}
foreach (TreeNode tnToCut in ROsSelectedforMultiMove)
{
VlnXmlElement ROtoCut = ((VlnXmlElement) tnToCut.Tag);
if (((VlnXmlElement)roTreeView.SelectedNode.Tag).GetAttribute("Table") != ROtoCut.GetAttribute("Table"))
{
MessageBox.Show("You can only move a RO within the same table.");
break; //exit foreach loop
}
string TheMenuTitle = ROtoCut.GetAttribute("MenuTitle");
if (!string.IsNullOrEmpty(TheMenuTitle))
{
TreeNode orig_parent = tnToCut.Parent;
if (moveRO(ROtoCut))
{
//if move was successful, remove the moved item from it's previous parent
//so it will only have a parent of where it moved to
XmlNode node = ROtoCut.ParentNode;
node.RemoveChild(ROtoCut);
if (orig_parent != null)
{
roTreeView.Nodes.Remove(tnToCut);
updateRoListView(orig_parent);
roTreeView.Refresh();
}
}
}
}
roTreeView_ClearAllMultiSelect();
tbtnRestore.Enabled = false;
tbtnSave.Enabled = false;
tbtnCancel.Enabled = true;
tbtnSaveAs.Enabled = false;
tbtnDuplicate.Enabled = true;
duplicate_active = false;
ROCutWasSelected = false;
menuROCut.Enabled = false;
roTreeView.ContextMenu.MenuItems[3].Enabled = menuROCut.Enabled;
menuROPaste.Enabled = false;
roTreeView.ContextMenu.MenuItems[4].Enabled = menuROPaste.Enabled;
roTreeView.Refresh();
}
//part of CSM-C2024-027 / Part of 2024 PROMS Upgrades
//Will move individual ROs
private bool moveRO(VlnXmlElement ROtoMove)
{
//making a copy into newro
//if everything is successful, once done
//will remove ROtoMove and keep the Clone with the changed position
//if any errors/issues, will remove the cloned newro and keep ROtoMove
VlnXmlElement newro = (VlnXmlElement)ROtoMove.Clone();
VlnXmlElement placetomoveroto = (VlnXmlElement)roTreeView.SelectedNode.Tag;
string orig_title = ROtoMove.GetMenuString(ROtoMove.GetMenuValueTemplate("MenuItem"), false);
//remove original link, and put it at new place in the menu
//set table to be new place that you are moving item to
//put at new place in menu
newro.SetAttribute("Table", placetomoveroto.GetAttribute("Table"));
newro.SetAttribute("ParentID", placetomoveroto.GetAttribute("RecID"));
placetomoveroto.AppendChild((XmlNode)newro);
//Check that must have the same Fields in use
string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used.
ArrayList AvailList_ROtoMove = myrodb.RODB_GetFields(ROtoMove, (uint)RecordType.Schema);
IEnumerable<ROField> InUseList_ROtoMove = myrodb.RODB_GetFieldsInUse(ROtoMove, AvailList_ROtoMove, "FieldsInUse", ref dummy, false).OfType<ROField>();
List<string> flds_InUseList_ROtoMove = InUseList_ROtoMove.Select(x => x.GetFieldname).OrderBy(t => t).ToList();
ArrayList AvailList_placetomoveroto = myrodb.RODB_GetFields(placetomoveroto, (uint)RecordType.Schema);
List<string> flds_InUseList_placetomoveroto = myrodb.RODB_GetFieldsInUse(placetomoveroto, AvailList_placetomoveroto, "FieldsInUse", ref dummy, false).OfType<ROField>().Select(x => x.GetFieldname).OrderBy(t => t).ToList();
if (!Enumerable.SequenceEqual(flds_InUseList_ROtoMove, flds_InUseList_placetomoveroto))
{
MessageBox.Show($"RO: {orig_title}. The fields in use must be the same between the item you are moving and where you are moving the item. The fields used in these values can be found under \"Properties => Referenced Object Definition\" of an RO Group. Cannot move.", "Problem moving RO item.");
placetomoveroto.RemoveChild(newro);
return false;
}
//if duplicate Accessory Page Id, return with Error message
string acctmpl = newro.GetAccPageIDTemplate();
string newacc = newro.GetAccPageIDString(acctmpl);
if (newacc == null)
{
MessageBox.Show($"RO: {orig_title}. Values for the fields used for the \"Accessory Pages Access\" are missing. The template required for the place this RO is moving to is: {acctmpl}", "Problem saving data");
placetomoveroto.RemoveChild(newro);
return false;
}
else if (myrodb.IsDuplicateAccPageID(newro, newacc))
{
MessageBox.Show($"RO: {orig_title}. The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
placetomoveroto.RemoveChild(newro);
return false;
}
//if already an item in the menu with the same title, then return with Error message
string mnutmp = newro.GetMenuValueTemplate("MenuItem");
string mnutitle = newro.GetMenuString(mnutmp, false);
if (newro.IsDuplicateMenuTitle(mnutitle))
{
MessageBox.Show($"RO: {orig_title}. The fields used for the \"Menu\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
placetomoveroto.RemoveChild(newro);
return false;
}
newro.SetAttribute("MenuTitle", mnutitle);
//Check that required Fields have Values
ArrayList reqfields = newro.GetRequiredFields();
foreach (string fldname in reqfields)
{
string fname_inxml = fldname.Split(new string[] { "\t" }, StringSplitOptions.None)[0];
string fname = CvtFldToUserFld(fname_inxml);
if (!InUseList_ROtoMove.Any(x=> x.GetFieldname == CvtFldToUserFld(fldname.Split(new string[] { "\t" }, StringSplitOptions.None)[0])) || newro.ChildNodes.Cast<XmlNode>().Any(x => x.Name == fname_inxml && x.InnerText.Length == 0))
{
MessageBox.Show($"RO: {orig_title}. Required field \"{fname}\" is missing a value that is required. Please be sure RO has a value for this field before moving the RO.", "Problem saving data");
placetomoveroto.RemoveChild(newro);
return false;
}
}
bool success = myrodb.RODB_WriteRO(newro, true);
//if successful, update the UI
if (success)
{
TreeNode newt = new TreeNode(mnutitle, ROIMAGE, ROIMAGE);
newt.Tag = newro;
newt.Name = newro.GetAttribute("RecID");
roTreeView.SelectedNode.Nodes.Add(newt);
updateRoListView(newt.Parent);
roTreeView.Refresh();
}
else
{
MessageBox.Show($"RO: {orig_title}. Unable to Move Item. An unexpected error occurred while moving the item, please contact Volian Support", "Problem saving moved item");
placetomoveroto.RemoveChild(newro);
roTreeView.Refresh();
}
return success;
}
#endregion
@@ -2404,6 +2676,7 @@ namespace ROEditor
int img = (myro.Name=="vlnGroup")?ROGROUPIMAGE:ROIMAGE;
newt = new TreeNode(mnutitle,img,img);
newt.Tag = myro;
newt.Name = myro.GetAttribute("RecID");
TreeNewparent.Nodes.Add(newt);
}
}
@@ -2506,12 +2779,14 @@ namespace ROEditor
if (acctmpl!=null)newro.SetAttribute("AccPageID", newro.GetAccPageIDString(acctmpl));
newro.SetAttribute("MenuTitle",mnutitle);
newro.RemoveAttribute("RecID"); // get a new one.
success = myrodb.RODB_InsertRO(newro);
if (success == true)
if (success)
{
int img = (newro.Name == "vlnGroup") ? ROGROUPIMAGE : ROIMAGE;
TreeNode newt = new TreeNode(mnutitle, img, img);
newt.Tag = newro;
newt.Name = newro.GetAttribute("RecID");
roTreeView.SelectedNode.Parent.Nodes.Add(newt);
roTreeView.SelectedNode.Tag = origro;
LastSelectedNode = newt; //do this so that no prompt for data save on node select
@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACE
CAAAAk1TRnQBSQFMAgEBAgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -175,7 +175,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAe
CwAAAk1TRnQBSQFMAgEBBgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CwAAAk1TRnQBSQFMAgEBBgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -336,10 +336,10 @@ namespace RODBInterface
public abstract bool RODB_GetChildData(VlnXmlElement node, bool CheckChildCount);
public abstract bool IsDuplicateAccPageID(VlnXmlElement ro, string newacc);
public abstract VlnXmlElement RODB_ReadRO(string tbl, string recid);
public abstract bool RODB_WriteRO(VlnXmlElement ro);
public abstract bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false);
public abstract bool RODB_InsertRO(VlnXmlElement ro);
public abstract ushort RODB_GetFieldType(VlnXmlElement elem, string TableName, string Fld);
public abstract ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype);
public abstract ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false);
public abstract string RODB_GetSchemaPiece(string Recid, string table);
public abstract bool RODB_NewSchemaPiece(string recid, string parentid, string table, string schpiece, uint rtype);
public abstract bool RODB_WriteSchemaPiece(string Recid, string table, string schpiece);
@@ -2120,7 +2120,7 @@ namespace RODBInterface
return retele;
}
public override bool RODB_WriteRO(VlnXmlElement ro)
public override bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false)
{
bool success;
if (ro.Name == "vlnGroup")
@@ -2140,6 +2140,13 @@ namespace RODBInterface
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
string xmlstr = GenerateXmlString(ro, false);
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'";
if (movedRO)
{
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
ro.SetAttribute("ParentID", parent.GetAttribute("RecID"));
strUpdate += ", ParentID = '" + ro.GetAttribute("ParentID") + "'";
}
strUpdate = strUpdate + ", ModDateTime = '" + dt + "', AccPageID = '" + wraccid + "' WHERE RecID='" + ro.GetAttribute("RecID") + "'";
try
{
@@ -2192,6 +2199,8 @@ namespace RODBInterface
ro.SetAttribute("HasChild", "False");
if (ro.HasAttribute("AccPageID"))
{
// Code is never reached, but this was noticed - this next line should likely be:
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
@@ -2294,11 +2303,16 @@ namespace RODBInterface
}
// For the given element's table, get all of the RO fields defined in this table.
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype)
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false)
{
string table = elem.GetAttribute("Table");
if (!FieldDefinitions.ContainsKey(table))
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
else if (refresh)
{
FieldDefinitions.Remove(table);
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
return FieldDefinitions[table];
}
private Dictionary<string, ArrayList> _FieldDefinitions = null;
@@ -2391,7 +2405,7 @@ namespace RODBInterface
Info = null;
DBE.ReaderClose();
DBE.CommandDispose();
return Info.Replace("&apos;", "\'");
return Info?.Replace("&apos;", "\'");
}
public override bool RODB_NewSchemaPiece(string recid, string parentid, string table, string schpiece, uint rtype)
@@ -1557,7 +1557,7 @@ namespace RODBInterface
}
return retele;
}
public override bool RODB_WriteRO(VlnXmlElement ro)
public override bool RODB_WriteRO(VlnXmlElement ro, bool movedRO = false)
{
bool success;
if (ro.Name == "vlnGroup")
@@ -1589,6 +1589,13 @@ namespace RODBInterface
command.Parameters.AddWithValue("@ModDateTime", dt);
command.Parameters.AddWithValue("@AccPageID", wraccid); // B2020-003: set accpageid to correct value
command.Parameters.AddWithValue("@RecID", ro.GetAttribute("RecID"));
if (movedRO)
{
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
ro.SetAttribute("ParentID", parent.GetAttribute("RecID"));
command.Parameters.AddWithValue("@ParentID", ro.GetAttribute("ParentID"));
}
using (SqlDataReader reader = command.ExecuteReader())
{
success = true;
@@ -1744,13 +1751,18 @@ namespace RODBInterface
return ftype;
}
// For the given element's table, get all of the RO fields defined in this table.
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype)
public override ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype, bool refresh = false)
{
string table = elem.GetAttribute("Table");
if (!FieldDefinitions.ContainsKey(table))
{
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
else if (refresh)
{
FieldDefinitions.Remove(table);
FieldDefinitions.Add(table, RODB_GetFieldsFromDB(elem));
}
return FieldDefinitions[table];
}
private Dictionary<string, ArrayList> _FieldDefinitions = null;
@@ -85,7 +85,7 @@ namespace VlnStatus
this.lblStatMsg.Name = "lblStatMsg";
this.lblStatMsg.Size = new System.Drawing.Size(420, 81);
this.lblStatMsg.TabIndex = 0;
this.lblStatMsg.Text = "Put Satus Message Here";
this.lblStatMsg.Text = "Put Status Message Here";
this.lblStatMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// StatusMessageFrm
+4 -2
View File
@@ -674,7 +674,8 @@ CREATE PROCEDURE [dbo].[updateInfoAccidByRecid]
@RecID char(8),
@AccPageID char(32),
@Info nvarchar(max),
@ModDateTime char(14)
@ModDateTime char(14),
@ParentID varchar(8) = NULL
)
WITH EXECUTE AS OWNER
AS
@@ -684,7 +685,8 @@ BEGIN TRY -- Try Block
SET
[Info]=@Info,
[ModDateTime]=@ModDateTime,
[AccPageID]=@AccPageID
[AccPageID]=@AccPageID,
[ParentID]=ISNULL(@ParentID, ParentID)
WHERE [ROTable]=@ROTable AND [RecID]=@RecID
IF @@ROWCOUNT = 0
BEGIN
+8 -3
View File
@@ -1654,6 +1654,10 @@ namespace VEPROMS
// B2017-214 added a null reference check
// B2010-071 Since we cannot tell if the user click on the X in Word or the X in PROMS, ask if the current tab
// should be closed or if we should exit PROMS or just Cancel to continue working
if (tc._MyDisplayTabItems.Count < 1) // If all thabs are closed in the editor will indicate that in the database.
{
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
}
if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0)
{
// B2019-071 dialog to ask user if we are to close one tab or exit
@@ -2349,6 +2353,7 @@ namespace VEPROMS
public void openDisplaytabstate()
{
// Retrieve edit tab state from database.
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
if (DisPlayTabState.Rows.Count > 0)
@@ -2356,11 +2361,11 @@ namespace VEPROMS
foreach (DataRow TabState in DisPlayTabState.Rows)
{
int _ItemID = (int)TabState["ItemID"];
//ItemInfoList _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure));
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
//ItemInfo.Get
//ItemInfo.Get
// Open procedure in the editor.
OpenItem(_Procedure);
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
}
}
}
@@ -1165,7 +1165,10 @@ namespace VEPROMS.CSLA.Library
{
int sp = odte.Link.IndexOf(" ") + 1; // get past tran type
string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp);
recid = System.Convert.ToInt32(srecid);
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
if (int.TryParse(srecid, out recid))
{
foreach (ContentTransition ct in itm.MyContent.ContentTransitions)
{
if (ct.TransitionID == recid)
@@ -1175,6 +1178,7 @@ namespace VEPROMS.CSLA.Library
}
}
}
}
else
{
int sp = odte.Link.IndexOf(" ");
@@ -1656,7 +1660,15 @@ namespace VEPROMS.CSLA.Library
private string FixTransition(string link, string text)
{
if (link.IndexOf("<NewID>") != -1) return text;
int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]);
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
int transitionID;
string[] splt_link = link.Split(' ');
if (splt_link.Length < 2 || !int.TryParse(splt_link[1], out transitionID))
{
return text;
}
// Find the transition
if (_MyItemInfo.MyContent.ContentTransitionCount <= 0)
{