Compare commits

...

4 Commits

Author SHA1 Message Date
7ade7f6e24 Merge pull request 'C2025-023-New-EP-Format-File' (#560) from C2025-023-New-EP-Format-File into C2025-023
Reviewed-on: #560
2025-05-20 17:21:25 -04:00
f49c888307 C2025-023 Electronic Procedures - Modifications to PROMS (Phase 1)
Changed linq to use builtin Find method per code analyzer recommendation
2025-05-15 10:57:28 -04:00
04a2da4371 C2025-023 Electronic Procedures - Modifications to PROMS (Phase 1)
Change to not show open button if is an invalid step type
2025-05-15 10:45:52 -04:00
31f608a9ec C2025-023 Electronic Procedures - Modifications to PROMS (Phase 1)
Change to not show open button if using a format that is not attached to an EP format file.
2025-05-14 15:05:58 -04:00
3 changed files with 14 additions and 4 deletions

View File

@@ -2117,11 +2117,14 @@ namespace VEPROMS.CSLA.Library
public EPFields GetValidEPFields(int AnnTypeID)
{
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.Find(x => x.AnnotationTypeID == AnnTypeID)?.FieldList;
if (unfiltered == null) return filtered;
//Build list of step type and step type of it's parents
List<string> steptypelist = new List<string>();
if ((int)MyContent.Type < 20000) return filtered;
int stepType = ((int)MyContent.Type) % 10000;
StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList;
if (stepType > sdlist.MaxIndex)
@@ -2152,6 +2155,13 @@ namespace VEPROMS.CSLA.Library
return filtered;
}
// C2025-023 - Electronic Procedures - Modifications to PROMS
//return true if any EP Format files attached to the item's
public bool HasEPformat(int AnnTypeID)
{
return GetValidEPFields(AnnTypeID).Count > 0;
}
// determine if the the current step should automatically be placed on the Continuous Action Summary
// Note, this logic only checks the format setting of the step. We will check the value of the Tag's Check Box later on.
public bool IncludeOnContActSum

View File

@@ -155,7 +155,7 @@ namespace Volian.Controls.Library
this.btnEPAnnotation.Margin = new System.Windows.Forms.Padding(2);
this.btnEPAnnotation.Name = "btnEPAnnotation";
this.btnEPAnnotation.Size = new System.Drawing.Size(53, 20);
this.superTooltip1.SetSuperTooltip(this.btnEPAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Remove Annotation", "", "This will remove the currently selected annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(this.btnEPAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Open Annotation", "", "This will open Electronic Procedure Details for this Annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnEPAnnotation.TabIndex = 5;
this.btnEPAnnotation.Text = "Open";
this.btnEPAnnotation.Visible = false;

View File

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