private void fieldLink1_ClickOverride()
 {
     IndicatorValueItemAdd form = new IndicatorValueItemAdd(new IndicatorDropdownValue { IndicatorId = 1, EntityType = IndicatorEntityType.Export }, new Indicator { DisplayName = "SurveyName" });
     form.OnSave += (v) =>
     {
         if (surveyNames.FirstOrDefault(s => s.DisplayName == v.DisplayName) != null)
         {
             MessageBox.Show(string.Format(Translations.ValidationMustBeUnique, Translations.SurveyName), Translations.ValidationErrorTitle);
             return;
         }
         surveyNames.Add(v);
         lbSurveyNames.Items.Add(v);
     };
     form.ShowDialog();
 }
Example #2
0
 private void AddNewVal(ListBox cntrl, Indicator indicator, IndicatorEntityType entityType)
 {
     IndicatorValueItemAdd form = new IndicatorValueItemAdd(new IndicatorDropdownValue { IndicatorId = indicator.Id, EntityType = entityType }, indicator);
     form.OnSave += (v) =>
     {
         cntrl.Items.Add(v);
     };
     form.ShowDialog();
 }