C2021-026 Parent/Child applicability in RO Editor

This commit is contained in:
2021-07-29 18:28:12 +00:00
parent 697490d5bf
commit ce9e9e182e
16 changed files with 1103 additions and 263 deletions

View File

@@ -251,7 +251,9 @@ namespace Volian.Controls.Library
switch (chld.type)
{
case 1: // standard (regular) text RO type
tbROValue.Text = chld.value.Replace(@"\u160?", " ");
string roval = chld.value.Replace(@"\u160?", " ");
roval = GetPCDefaultValue(roval); // C2021-026 get the default RO value from P/C RO value information
tbROValue.Text = roval;
btnPreviewRO.Enabled = false;
if (chld.roid.StartsWith("FFFF"))
btnGoToRO.Enabled = false;
@@ -317,6 +319,23 @@ namespace Volian.Controls.Library
}
private E_ROValueType _CurrentROTypeFilter = E_ROValueType.All;
// C2021-026 Get the Parent (Default) RO value if the return value include P/C information
// otherwise return the RO value as is.
// This is used for the insert RO interface on the Step Properties pannel
private string GetPCDefaultValue(string roval)
{
string rntval = roval;
while (rntval.Contains("<APL DefaultVal=")) // C2021-026 remove Parent/Child values for the menu item text
{
int startCVIdx = rntval.IndexOf("<APL DefaultVal=");
int EndCVidx = rntval.IndexOf(" /APL>", startCVIdx);
string aplicValues = rntval.Substring(startCVIdx, EndCVidx + 6 - startCVIdx);
int endDefIdx = rntval.IndexOf(",", startCVIdx);
string defValue = rntval.Substring(startCVIdx + 16, endDefIdx - (startCVIdx + 16));
rntval = rntval.Replace(aplicValues, defValue);
}
return rntval;
}
private void LoadChildren(TreeNode tn)
{
object tag = tn.Tag;
@@ -378,7 +397,9 @@ namespace Volian.Controls.Library
//}
else
{
tmp = new TreeNode(chld[i].title.Replace(@"\u160?"," "));
string ntitle = chld[i].title.Replace(@"\u160?", " ");
ntitle = GetPCDefaultValue(ntitle); // C2021-026 get the default RO value from P/C RO value information
tmp = new TreeNode(ntitle);
tmp.Tag = chld[i];
if (chld[i].roid.Length == 16)
tn.Nodes.Add(tmp);
@@ -887,6 +908,14 @@ namespace Volian.Controls.Library
string args = "\"" + _MyROFST.MyRODb.FolderPath + "\" " + roch.roid.ToLower();
// C2017-003: ro data in sql server, check for sql connection string
if (_MyROFST.MyRODb.DBConnectionString != "cstring") args = args + " \"" + _MyROFST.MyRODb.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = Mydvi.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str!="" && str!="0")
args += " \"PC=" + str + "\"";
}
System.Diagnostics.Process.Start(roapp, args);
}
}
@@ -929,6 +958,14 @@ namespace Volian.Controls.Library
}
// C2017-003: ro data in sql server, check for sql connection string
if (_MyROFST.MyRODb.DBConnectionString != "cstring") args = args + " \"" + _MyROFST.MyRODb.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = Mydvi.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str != "" && str !="0")
args += " \"PC=" + str + "\"";
}
System.Diagnostics.Process.Start(roapp, args);
}
}

View File

@@ -938,6 +938,16 @@ namespace Volian.Controls.Library
string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\" \"/f=" + fname + "\"";
// C2017-003: ro data in sql server, check for sql connection string
if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") roloc = roloc + " \"/sql=" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = MyDVI.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str != "" && str != "0")
roloc += " \"/PC=" + str + "\"";
}
System.Diagnostics.Process p = System.Diagnostics.Process.Start(cmpRptExePath, roloc);
// need to wait, sometimes the Print.tmp file that is generated is not available
p.WaitForExit(); // without arguments, this will wait indefinitely

View File

@@ -3112,6 +3112,14 @@ namespace Volian.Controls.Library
}
// C2017-003: ro data in sql server, check for sql connection string
if (myRODB.DBConnectionString != "cstring") args = args + " \"" + myRODB.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = Mydvi.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str!="" && str!="0")
args += " \"PC=" + str + "\"";
}
System.Diagnostics.Process.Start(roapp, args);
}
}
@@ -3268,6 +3276,14 @@ namespace Volian.Controls.Library
}
// C2017-003: ro data in sql server, check for sql connection string
if (Mydvi.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") roloc = roloc + " \"" + Mydvi.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = Mydvi.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str!="" && str!="0")
roloc += " \"PC=" + str + "\"";
}
System.Diagnostics.Process.Start(roapp, roloc);
}

View File

@@ -2088,7 +2088,16 @@ namespace Volian.Controls.Library
return;
}
// C2017-003: ro data in sql server, check for sql connection string
if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring") roloc = roloc + " \"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\"";
if (MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString != "cstring")
roloc = roloc + " \"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.DBConnectionString + "\"";
// C2021-026 pass in Parent/Child information (list of the children)
DocVersionConfig dvc = MyDVI.DocVersionConfig as DocVersionConfig;
if (dvc != null)
{
string str = dvc.Unit_Name;
if (str !="" && str != "0")
roloc += " \"PC=" + str + "\"";
}
System.Diagnostics.Process.Start(roapp, roloc);
}