zhaw-dnet2/Tasks/Lab8/DataAdapter/MainWindow.xaml.cs

59 lines
1.9 KiB
C#
Raw Normal View History

2024-06-06 16:59:42 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DataAdapter
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
2024-06-06 17:33:45 +00:00
private FlughafenDBDataSet flughafenDBDataSet;
private FlughafenDBDataSetTableAdapters.FlugTableAdapter flughafenDBDataSetFlugTableAdapter;
private CollectionViewSource flugViewSource;
2024-06-06 16:59:42 +00:00
public MainWindow()
{
InitializeComponent();
}
2024-06-06 17:33:45 +00:00
private void Window_Loaded(object sender, RoutedEventArgs e)
{
flughafenDBDataSet = (FlughafenDBDataSet)FindResource("flughafenDBDataSet");
// Load data into the table Flug. You can modify this code as needed.
flughafenDBDataSetFlugTableAdapter = new FlughafenDBDataSetTableAdapters.FlugTableAdapter();
flughafenDBDataSetFlugTableAdapter.Fill(flughafenDBDataSet.Flug);
flugViewSource = (CollectionViewSource)FindResource("flugViewSource");
flugViewSource.View.MoveCurrentToFirst();
}
private void BackButton_Click(object sender, RoutedEventArgs e)
{
flugViewSource.View.MoveCurrentToPrevious();
}
private void NextButton_Click(object sender, RoutedEventArgs e)
{
flugViewSource.View.MoveCurrentToNext();
}
private void saveButton_Click(object sender, RoutedEventArgs e)
{
flughafenDBDataSetFlugTableAdapter.Update(flughafenDBDataSet.Flug);
}
2024-06-06 16:59:42 +00:00
}
}