C2025-023 Electronic Procedures - Modifications to PROMS (Phase 1)

Change to not show open button if is an invalid step type
This commit is contained in:
Matthew Schill 2025-05-15 10:45:52 -04:00
parent 31f608a9ec
commit 04a2da4371
2 changed files with 8 additions and 5 deletions

View File

@ -2117,11 +2117,14 @@ namespace VEPROMS.CSLA.Library
public EPFields GetValidEPFields(int AnnTypeID) public EPFields GetValidEPFields(int AnnTypeID)
{ {
EPFields filtered = new EPFields(); EPFields filtered = new EPFields();
EPFields unfiltered = ActiveFormat.PlantFormat.EPFormatFiles.First(x => x.AnnotationTypeID == AnnTypeID).FieldList;
if (ActiveFormat.PlantFormat.EPFormatFiles.Count == 0) return filtered;
if ((int)MyContent.Type < 20000) return filtered;
EPFields unfiltered = ActiveFormat.PlantFormat.EPFormatFiles.FirstOrDefault(x => x.AnnotationTypeID == AnnTypeID)?.FieldList;
if (unfiltered == null) return filtered;
//Build list of step type and step type of it's parents //Build list of step type and step type of it's parents
List<string> steptypelist = new List<string>(); List<string> steptypelist = new List<string>();
if ((int)MyContent.Type < 20000) return filtered;
int stepType = ((int)MyContent.Type) % 10000; int stepType = ((int)MyContent.Type) % 10000;
StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList; StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList;
if (stepType > sdlist.MaxIndex) if (stepType > sdlist.MaxIndex)
@ -2154,9 +2157,9 @@ namespace VEPROMS.CSLA.Library
// C2025-023 - Electronic Procedures - Modifications to PROMS // C2025-023 - Electronic Procedures - Modifications to PROMS
//return true if any EP Format files attached to the item's //return true if any EP Format files attached to the item's
public bool HasEPformat() public bool HasEPformat(int AnnTypeID)
{ {
return ActiveFormat.PlantFormat.EPFormatFiles.Count > 0; return GetValidEPFields(AnnTypeID).Count > 0;
} }
// determine if the the current step should automatically be placed on the Continuous Action Summary // determine if the the current step should automatically be placed on the Continuous Action Summary

View File

@ -340,7 +340,7 @@ namespace Volian.Controls.Library
if ((_Annotations != null) && (dgAnnotations.Rows.Count > 0)) if ((_Annotations != null) && (dgAnnotations.Rows.Count > 0))
{ {
CurrentAnnotation = _Annotations[dgAnnotations.CurrentRow.Index]; CurrentAnnotation = _Annotations[dgAnnotations.CurrentRow.Index];
if (CurrentAnnotation.MyAnnotationType.IsEPAnnotationType && CurrentItem.HasEPformat()) if (CurrentAnnotation.MyAnnotationType.IsEPAnnotationType && CurrentItem.HasEPformat(CurrentAnnotation.MyAnnotationType.TypeID))
btnEPAnnotation.Visible = true; btnEPAnnotation.Visible = true;
} }
else else