B2026-091 RO Editor - Change Default Prefix to take existing prefixes into account for Setpoint/Graphics DBs

This commit is contained in:
mschill committed 2026-10-22 07:30:36 -04:00
1 parent cb5bb715cf
commit 87e163af15
3 files changed
+179 -147

No files matched your search

@@ -127,12 +127,13 @@ namespace ROEditor
private string origPrefix;
private string origValue;
private int dbtype;
private bool IsNewGroup = false;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public GroupDefFrm(VlnXmlElement pelem, RODB rodb, string gpname,int idbtype)
public GroupDefFrm(VlnXmlElement pelem, RODB rodb, string gpname,int idbtype, bool newgrp = false)
{
myrodb = rodb;
elem = pelem;
@@ -143,7 +144,8 @@ namespace ROEditor
//
InitializeComponent();
FillInData();
}
IsNewGroup = newgrp;
}
private string CvtUserFldToFld(string fldname)
{
@@ -655,10 +657,11 @@ namespace ROEditor
tmpn.FirstChild.Value = tmpstr2; //tmpn.FirstChild.Value.Replace(CvtUserFldToFld(origGroup), this.tbGroup.Text);
modified=true;
}
if ((elem.HasAttribute("AccPageIDPrefix")&&this.tbPrefix.Text != origPrefix) || this.tbPrefix.Modified==true)
if ((elem.HasAttribute("AccPageIDPrefix")&&(tbPrefix.Text != origPrefix || IsNewGroup)) || tbPrefix.Modified)
{
elem.SetAttribute("AccPageIDPrefix",this.tbPrefix.Text);
modified=true;
IsNewGroup = false;
if (myrodb.IsDuplicateAccPagePrefix(elem, tbPrefix.Text))
{
@@ -666,7 +669,8 @@ namespace ROEditor
elem.SetAttribute("AccPageIDPrefix", origPrefix);
modified = false;
MessageBox.Show($"The Prefix field used for the \"Accessory Pages Access\" values should be unique. The fields used in these values can be found under \"Properties\" of an RO Group. If these are not unique, you may have trouble utilizing these ROs within Word Sections in PROMS. Cannot save.", "Problem saving data");
return;
DialogResult = DialogResult.Cancel;
return;
}
}
bool success=true;