Example #1
0
 private void TablesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (TablesComboBox.SelectedValue != null)
     {
         string nameTable = TablesComboBox.SelectedValue.ToString();
         TitlesListBox.ItemsSource   = DataBaseSupport.GetTitles(nameTable);
         TitlesListBox.SelectedIndex = 0;
     }
 }
Example #2
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());
            }
        }
Example #3
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);
         }
     }
 }
Example #4
0
        private void DelTitleButton_Click(object sender, RoutedEventArgs e)
        {
            string query = String.Format("DELETE FROM {0} WHERE NAME='{1}';",
                                         TablesComboBox.SelectedValue.ToString(),
                                         TitlesListBox.SelectedItem.ToString());

            DataBaseSupport.SendQuery(query);
            if (TablesComboBox.SelectedValue != null)
            {
                TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(TablesComboBox.SelectedValue.ToString());
            }
        }
Example #5
0
        private void PrimenitButton_Click(object sender, RoutedEventArgs e)
        {
            string query = String.Format("UPDATE {0} SET TitleText='{1}' WHERE NAME='{2}';",
                                         TablesComboBox.SelectedValue.ToString(),
                                         TextTitle.Text,
                                         TitlesListBox.SelectedItem.ToString());

            DataBaseSupport.SendQuery(query);
            if (TablesComboBox.SelectedValue != null)
            {
                TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(TablesComboBox.SelectedValue.ToString());
            }
        }