소스 검색

Fixed duplicate code exception in DF dashboard

Kenric Nugteren 2 년 전
부모
커밋
d4c2003f4c
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      prs.desktop/Dashboards/DigitalFormsDashboard.xaml.cs

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

@@ -947,7 +947,14 @@ namespace PRSDesktop
                 {
                 {
                     var code = variable.Code.Replace("/", " ");
                     var code = variable.Code.Replace("/", " ");
                     QuestionCodes[code] = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(code.ToLower());
                     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())
             else if (questions.Any())