private void btnNextTab_Click(object sender, RoutedEventArgs e) { furDataSet furDataSet = ((WpfApp1.furDataSet)(this.FindResource("furDataSet"))); WpfApp1.furDataSetTableAdapters.furnitureTableAdapter furDataSetfurnitureTableAdapter = new WpfApp1.furDataSetTableAdapters.furnitureTableAdapter(); furDataSetfurnitureTableAdapter.Update(furDataSet.furniture); MessageBox.Show("Данные сохранены"); }
private void BtnSaveToXMLroom_Click(object sender, RoutedEventArgs e) { furDataSet furDataSet = ((WpfApp1.furDataSet)(this.FindResource("furDataSet"))); //WpfApp1.furDataSetTableAdapters.roomTableAdapter furDataSetroomTableAdapter = new WpfApp1.furDataSetTableAdapters.roomTableAdapter(); //furDataSetroomTableAdapter.Update(furDataSet.room); furDataSet.room.WriteXml("room.xml"); MessageBox.Show("Данные выгружены в файл room.xml"); }
private void BtnRefresh_Click(object sender, RoutedEventArgs e) { furDataSet furDataSet = ((WpfApp1.furDataSet)(this.FindResource("furDataSet"))); WpfApp1.furDataSetTableAdapters.joinTableAdapter furDataSetjoinTableAdapter = new WpfApp1.furDataSetTableAdapters.joinTableAdapter(); furDataSetjoinTableAdapter.Fill(furDataSet.join); System.Windows.Data.CollectionViewSource joinViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("joinViewSource"))); joinViewSource.View.MoveCurrentToFirst(); MessageBox.Show("Информация в таблице обновлена"); }
private void btnPreviousTab_Click(object sender, RoutedEventArgs e) { furDataSet furDataSet = ((WpfApp1.furDataSet)(this.FindResource("furDataSet"))); //furDataSet.room.AcceptChanges(); //furDataSet.AcceptChanges(); WpfApp1.furDataSetTableAdapters.roomTableAdapter furDataSetroomTableAdapter = new WpfApp1.furDataSetTableAdapters.roomTableAdapter(); furDataSetroomTableAdapter.Update(furDataSet.room); MessageBox.Show("Данные сохранены"); }
private void BtnLoadFromXMLroom_Click(object sender, RoutedEventArgs e) { furDataSet furDataSet = ((WpfApp1.furDataSet)(this.FindResource("furDataSet"))); try { furDataSet.room.Clear(); furDataSet.room.ReadXml("room.xml"); //WpfApp1.furDataSetTableAdapters.roomTableAdapter furDataSetroomTableAdapter = new WpfApp1.furDataSetTableAdapters.roomTableAdapter(); //furDataSetroomTableAdapter.Update(furDataSet.room); MessageBox.Show("Данные загружены из файла room.xml"); } catch { MessageBox.Show("Что-то пошло не так, проверьте наличие файла room.xml в каталоге программы"); } }