From e1945e3c417532bc2fb9125d2ecdbee41d548136 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 13 Jan 2015 16:31:17 +0000 Subject: [PATCH] Logic to include places where there are missing RO on the RO Usage Report. --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 2 +- .../Config/ROFSTLookup.cs | 36 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 31f6a809..aee6a21d 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -722,7 +722,7 @@ namespace VEPROMS { if (args.TypesSelected == "RO Usage") { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.MyItemInfoList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROUsageReport.pdf", args.SortUsageByProcedure); + Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.MyItemInfoList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROUsageReport.pdf", args.SortUsageByProcedure,args.IncludeMissingROs); myReport.Build(); } else if (args.TypesSelected == "Complete RO Report") diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 514c6778..ba46cd04 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -472,25 +472,31 @@ namespace VEPROMS.CSLA.Library // Return the RO Title in a list of strings // The last item in the list is the actual RO title, the items preceding it are the // titles of the groups and sub-groups containing the RO - public List GetROTitleAndGroupPath(string ROID) + public List GetROTitleAndGroupPath(string ROID, bool reportMissingROs) { List titlePath = new List(); rochild roc = GetRoChild12(ROID); - string tmp = roc.title; - if (roc.appid != "") - if (roc.title.Contains(roc.appid)) - tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim(); - else - tmp = string.Format("[{0}] {1}", roc.appid, roc.title); - titlePath.Add(tmp); - do + if (roc.appid != null) { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild12(parent); - if (roc.ID > 0) - titlePath.Add(roc.title); - } while (roc.ID > 0); - titlePath.Reverse(); + string tmp = roc.title; + if (roc.appid != "") + if (roc.title.Contains(roc.appid)) + tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim(); + else + tmp = string.Format("[{0}] {1}", roc.appid, roc.title); + titlePath.Add(tmp); + do + { + string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); + roc = GetRoChild12(parent); + if (roc.ID > 0) + titlePath.Add(roc.title); + } while (roc.ID > 0); + titlePath.Reverse(); + } + else if (reportMissingROs) // Missing RO, put a message with the ROID on the report... + titlePath.Add(string.Format("Missing RO for ROID {0}", ROID)); + return titlePath; } public List GetROTitleAndGroupPathForSummary(string ROID)