示例#1
0
        private void addToolStripButton_Click(object sender, EventArgs e)
        {
            EditTableSizeEntry editTableSizeEntry = new EditTableSizeEntry();

            if (editTableSizeEntry.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string       sqlDBName = editTableSizeEntry.DatabaseEntry.SqlServer.ToUpper() + "\\" + editTableSizeEntry.DatabaseEntry.Name;
                ListViewItem lvi       = new ListViewItem(sqlDBName);
                lvi.SubItems.Add(editTableSizeEntry.DatabaseEntry.TableSizeEntries.Count.ToString());
                lvi.Tag = editTableSizeEntry.DatabaseEntry;
                lvwTables.Items.Add(lvi);
                CheckOKEnabled();
            }
        }
示例#2
0
 private void editToolStripButton_Click(object sender, EventArgs e)
 {
     if (lvwTables.SelectedItems.Count > 0)
     {
         EditTableSizeEntry editTableSizeEntry = new EditTableSizeEntry();
         editTableSizeEntry.DatabaseEntry = (DatabaseEntry)lvwTables.SelectedItems[0].Tag;
         if (editTableSizeEntry.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string sqlDBName = editTableSizeEntry.DatabaseEntry.SqlServer.ToUpper() + "\\" + editTableSizeEntry.DatabaseEntry.Name;
             lvwTables.SelectedItems[0].Text             = sqlDBName;
             lvwTables.SelectedItems[0].SubItems[1].Text = editTableSizeEntry.DatabaseEntry.TableSizeEntries.Count.ToString();
             lvwTables.SelectedItems[0].Tag = editTableSizeEntry.DatabaseEntry;
         }
     }
     CheckOKEnabled();
 }