Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/kenric' into frank

Frank van den Bos 2 anni fa
parent
commit
35269d940e

+ 8 - 1
prs.desktop/Dashboards/Common/DigitalFormsDashboard.xaml.cs

@@ -947,7 +947,14 @@ namespace PRSDesktop
                 {
                     var code = variable.Code.Replace("/", " ");
                     QuestionCodes[code] = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(code.ToLower());
-                    data.Columns.Add(code, typeof(string));
+                    try
+                    {
+                        data.Columns.Add(code, typeof(string));
+                    }
+                    catch(DuplicateNameException e)
+                    {
+                        MessageBox.Show($"Error: duplicate variable code {code}");
+                    }
                 }
             }
             else if (questions.Any())