예제 #1
0
 public MainWindow()
 {
     InitializeComponent();
     TablesComboBox.ItemsSource   = DataBaseSupport.GetTables();
     TablesComboBox.SelectedIndex = 0;
     //TitelsText.ItemsSource = GetTitles(TablesComboBox.Text);
 }
예제 #2
0
 private void TitlesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     TablesComboBox.ItemsSource = DataBaseSupport.GetTables();
     TextTitle.Text             = "";
     if (TitlesListBox.SelectedValue != null)
     {
         string title = TitlesListBox.SelectedValue.ToString();
         TextTitle.Text = DataBaseSupport.records[title];
     }
 }
예제 #3
0
        private void DelTableButton_Click(object sender, RoutedEventArgs e)
        {
            string str = TablesComboBox.Text.ToString();

            DataBaseSupport.DeleteTable(str);
            TablesComboBox.ItemsSource = DataBaseSupport.GetTables();
            if (TablesComboBox.SelectedValue != null)
            {
                TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(TablesComboBox.SelectedValue.ToString());
            }
        }
예제 #4
0
 private void Window_Activated(object sender, EventArgs e)
 {
     TablesComboBox.ItemsSource = DataBaseSupport.GetTables();
     if (TablesComboBox.SelectedValue != null)
     {
         string nameTable = TablesComboBox.SelectedValue.ToString();
         if (nameTable.Length > 0)
         {
             TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(nameTable);
         }
     }
 }