C2025-023 - Electronic Procedures - Modifications to PROMS - checkin #2

This commit is contained in:
2025-04-09 15:22:36 -04:00
parent 6fd84e2f2a
commit 389b9e382b
2 changed files with 99 additions and 24 deletions

View File

@@ -316,10 +316,10 @@ namespace VEPROMS.CSLA.Library
}
//return a list of items based on the ROsource specified in the EPFormat File
public Dictionary<int, string> getROList(AnnotationInfo currAnn)
public List<ROListItem> getROList(AnnotationInfo currAnn, bool includeblank)
{
if (string.IsNullOrEmpty(rosource))
return new Dictionary<int, string>();
return new List<ROListItem>();
try
{
@@ -329,8 +329,11 @@ namespace VEPROMS.CSLA.Library
string roid = FormatRoidKey(rosource, false);
rochild[] children = lookup.GetRoChildrenByRoid(roid);
return children.Select(x => new { x.ID, x.title }).ToDictionary(t => t.ID, t => t.title);
List<ROListItem> mylist = children.Select(x => new ROListItem(x.title, x.ID)).ToList();
if (includeblank)
mylist.Insert(0, new ROListItem("", -1));
return mylist;
}
catch (Exception Ex)
{
@@ -339,5 +342,18 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
//C2025-023 - Electronic Procedures - Modifications to PROMS
// class to handle return of RO Lists
#region EPFormatFiles
public class ROListItem
{
public string Text { get; private set; }
public int Value { get; private set; }
public ROListItem(string _text, int _value)
{
Text = _text; Value = _value;
}
}
#endregion
}