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

This commit is contained in:
John Jenko 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);
}

View File

@ -940,12 +940,15 @@ namespace Volian.Controls.Library
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)
// 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")
roloc += " \"/PC=" + str + "\"";
DocVersionConfig dvc = dvi.DocVersionConfig as DocVersionConfig;
if (dvc != null && dvc.Unit_Name != "" && dvc.Unit_Name != "0")
roloc += " \"/PC=" + dvc.Unit_Name + "\"";
break;
}
System.Diagnostics.Process p = System.Diagnostics.Process.Start(cmpRptExePath, roloc);

View File

@ -3129,12 +3129,15 @@ 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)
// 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);
}
@ -3293,12 +3296,15 @@ 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)
// 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")
roloc += " \"PC=" + str + "\"";
DocVersionConfig dvc = dvi.DocVersionConfig as DocVersionConfig;
if (dvc != null && dvc.Unit_Name != "" && dvc.Unit_Name != "0")
roloc += " \"PC=" + dvc.Unit_Name + "\"";
break;
}
System.Diagnostics.Process.Start(roapp, roloc);
}

View File

@ -2093,12 +2093,15 @@ namespace Volian.Controls.Library
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)
// 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")
roloc += " \"PC=" + str + "\"";
DocVersionConfig dvc = dvi.DocVersionConfig as DocVersionConfig;
if (dvc != null && dvc.Unit_Name != "" && dvc.Unit_Name != "0")
roloc += " \"PC=" + dvc.Unit_Name + "\"";
break;
}
System.Diagnostics.Process.Start(roapp, roloc);
}