Esempio n. 1
0
 private void promptToDelete()
 {
     if (lvGroups.SelectedItems.Count > 0)
     {
         if (DialogResult.Yes == MessageBox.Show(this, getDisplayMember("promptToDelete{delete_body}", "Deleting the code group(s) will cause all dataviews and tables that are referencing them to appear as free-form textboxes in the Curator Tool.\r\nAre you sure you want to delete code group(s)"),
                                                 getDisplayMember("promptToDelete{delete_title}", "Delete Code Group(s)?"), MessageBoxButtons.YesNo, MessageBoxIcon.Question))
         {
             var delcount = 0;
             foreach (ListViewItem lvi in lvGroups.SelectedItems)
             {
                 var cg = lvi.Tag as string;
                 if (Array.IndexOf(frmCodeGroup.RESERVED_CODE_GROUPS, cg) > -1)
                 {
                     MessageBox.Show(this,
                                     getDisplayMember("promptToDelete{required_body}", "Code group {0} cannot be deleted because it is required by the system.", cg),
                                     getDisplayMember("promptToDelete{required_title}", "Code Group Required"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     AdminProxy.DeleteCodeGroup(lvi.Tag as string);
                     delcount++;
                 }
             }
             MainFormUpdateStatus(getDisplayMember("promptToDelete{deleted}", "Deleted {0} code group(s).", delcount.ToString("###,###,##0")), true);
             RefreshData();
         }
     }
 }