Skip to content

Commit 6d41b7b

Browse files
committed
Fix #1
1 parent 4177482 commit 6d41b7b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Assets/UXF/Scripts/UI/ParticipantListSelection.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,20 @@ public string Finish()
209209
// if we have new participant selected, we need to create it in the pplist
210210
if (participantSelector.IsNewSelected())
211211
{
212-
// add new participant to list
213-
row = ppList.NewRow();
214-
ppList.Rows.Add(row);
212+
// if new participant is given an id that exists in pplist, throw error
213+
DataRow searchResultRow = ppList.AsEnumerable().SingleOrDefault(r => r.Field<string>("ppid") == ppid);
214+
if (searchResultRow != null)
215+
{
216+
form.ppidElement.controller.DisplayFault();
217+
throw new Exception("Participant ID already exists! Enter a new ID or select the existing participant from the dropdown.");
218+
}
219+
// else new id has been entered
220+
else
221+
{
222+
// add new participant to list
223+
row = ppList.NewRow();
224+
ppList.Rows.Add(row);
225+
}
215226
}
216227
// else we update the row with any changes we made in the form
217228
else

0 commit comments

Comments
 (0)