From 77ff645e2cd280590734a45c2e7caab61dad3143 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 25 Jan 2022 13:45:38 +0000 Subject: [PATCH] B2022-019 pass in Parent/Child even when not calling from a Parent/Child set --- PROMS/Volian.Controls.Library/DisplayRO.cs | 26 ++++++++++++------- .../Volian.Controls.Library/DisplayReports.cs | 13 ++++++---- .../Volian.Controls.Library/StepTabRibbon.cs | 26 ++++++++++++------- PROMS/Volian.Controls.Library/vlnTreeView.cs | 13 ++++++---- 4 files changed, 48 insertions(+), 30 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 7b3304d4..8f0f9996 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -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); } diff --git a/PROMS/Volian.Controls.Library/DisplayReports.cs b/PROMS/Volian.Controls.Library/DisplayReports.cs index 2a3362ae..c86f98b9 100644 --- a/PROMS/Volian.Controls.Library/DisplayReports.cs +++ b/PROMS/Volian.Controls.Library/DisplayReports.cs @@ -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); diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 43e01701..d6e5a2b2 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -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); } diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 4af9d3a3..f9ceb014 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -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); }