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()); } }
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()); } }