B2022-019 pass in Parent/Child even when not calling from a Parent/Child set

This commit is contained in:
2022-01-25 13:45:38 +00:00
parent 31dd017354
commit 77ff645e2c
4 changed files with 48 additions and 30 deletions

View File

@@ -911,12 +911,15 @@ 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)
// B2022-019 look at all DocVersions to find ParentChild information
// to ensure we pass in Parent/Child even when not coming from a Parent/Child procedure set
DocVersionInfoList dvil = DocVersionInfoList.Get();
foreach (DocVersionInfo dvi in dvil)
{
string str = dvc.Unit_Name;
if (str!="" && str!="0")
args += " \"PC=" + str + "\"";
DocVersionConfig dvc = dvi.DocVersionConfig as DocVersionConfig;
if (dvc != null && dvc.Unit_Name != "" && dvc.Unit_Name != "0")
args += " \"PC=" + dvc.Unit_Name + "\"";
break;
}
System.Diagnostics.Process.Start(roapp, args);
}
@@ -961,12 +964,15 @@ 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)
// B2022-019 look at all DocVersions to find ParentChild information
// to ensure we pass in Parent/Child even when not coming from a Parent/Child procedure set
DocVersionInfoList dvil = DocVersionInfoList.Get();
foreach (DocVersionInfo dvi in dvil)
{
string str = dvc.Unit_Name;
if (str != "" && str !="0")
args += " \"PC=" + str + "\"";
DocVersionConfig jdvc = dvi.DocVersionConfig as DocVersionConfig;
if (jdvc != null && jdvc.Unit_Name != "" && jdvc.Unit_Name!= "0")
args += " \"PC=" + jdvc.Unit_Name + "\"";
break;
}
System.Diagnostics.Process.Start(roapp, args);
}