diff --git a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs index 84b71cc6..9bdb1720 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs @@ -61,6 +61,13 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _AnnotationTypeID, "@AnnotationTypeID"); } } + + // Return Name of Annotation that EP Format File is Attached to + public string AnnotationName() + { + return AnnotationTypeInfo.Get((int) AnnotationTypeID).Name; + } + //if xml value is blank, should element export? //defaults to true private LazyLoad _exportblank; @@ -373,7 +380,6 @@ namespace VEPROMS.CSLA.Library } } - //return a list of values for the specified ROID //given the EP items return columns //will return all RO items under the Group that's roid = the rosource @@ -406,6 +412,7 @@ namespace VEPROMS.CSLA.Library } } + #endregion //C2025-023 - Electronic Procedures - Modifications to PROMS // class to handle return of RO Lists diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 95beb6f2..b926f150 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -875,7 +875,9 @@ namespace Volian.Controls.Library if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion)) { cm.MenuItems.Add("Export Procedure", mi_Click); - AddEPExport(cm.MenuItems, pri.MyDocVersion.MultiUnitCount, pri.MyDocVersion.UnitNames); + //C2025-024 Proms XML Output - if have any EP Format files, add dropdown menu for exporting EP formats + if (pri.ActiveFormat.PlantFormat.EPFormatFiles.Count > 0) + AddEPExport(cm.MenuItems, pri.MyDocVersion.MultiUnitCount, pri.MyDocVersion.UnitNames, pri.ActiveFormat.PlantFormat.EPFormatFiles); } if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion) || ui.IsWriter(pri.MyDocVersion)) { @@ -1392,24 +1394,15 @@ namespace Volian.Controls.Library // Add context menu for exporting Electronic Procedures // if has an Electronic procedure // then loop through and add an Export for each EP Viewer - private void AddEPExport(Menu.MenuItemCollection menuItems, int MultiUnitCount, string[] UnitNames) + private void AddEPExport(Menu.MenuItemCollection menuItems, int MultiUnitCount, string[] UnitNames, EPFormatFiles EPFiles) { - //get EP Annotations - AnnotationTypeInfoList annotations = AnnotationTypeInfoList.Get(); - List epAnnotations = new List(); - foreach (AnnotationTypeInfo tmp in annotations) - { - if (tmp.IsEPAnnotationType) epAnnotations.Add(tmp); - } - - if (epAnnotations.Count == 0) return; // no Electronic Procedures - //add outer menu MenuItem mi = menuItems.Add("Electronic Procedure Viewer Export"); - foreach (AnnotationTypeInfo epAnn in epAnnotations) + foreach (EPFormatFile epAnnType in EPFiles) { + //Add item for each individual EP Viewer - MenuItem mv = mi.MenuItems.Add(epAnn.Name); + MenuItem mv = mi.MenuItems.Add(epAnnType.AnnotationName()); //tag will be of format: //{EP Annotation Type ID},{Unit} @@ -1422,13 +1415,13 @@ namespace Volian.Controls.Library { k++; MenuItem multiunit_mv = mv.MenuItems.Add(s); - multiunit_mv.Tag = $"{epAnn.TypeID},{k}"; + multiunit_mv.Tag = $"{epAnnType.AnnotationTypeID},{k}"; multiunit_mv.Click += new EventHandler(miEP_Click); } } else { - mv.Tag = $"{epAnn.TypeID},0"; + mv.Tag = $"{epAnnType.AnnotationTypeID},0"; mv.Click += new EventHandler(miEP_Click); } }