private void InsertBtn_click(object sender, RoutedEventArgs e) { ShowResult(); if (RecordDao.CheckTheRecord(currentRecord)) { System.Windows.MessageBox.Show("This expression already exisits."); } else { RecordDao.InsertTheRecord(currentRecord); } }
private void DeleBtn_click(object sender, RoutedEventArgs e) { RecordObj selectedRecord = (RecordObj)RecordsView.SelectedItem; if (selectedRecord == null) { System.Windows.MessageBox.Show("Please select a record"); } else { RecordDao.DeleteTheRecord(selectedRecord); RefreshTheList(); } }
private void RefreshTheList() { List <RecordObj> records = RecordDao.QueryAllRecord(); RecordsView.ItemsSource = records; }
public MainWindow() { InitializeComponent(); RecordDao.InitDB(); Query.Visibility = Visibility.Hidden; }