Skip to content

Commit

Permalink
<feat: add reload function to refresh data in Today Order page>
Browse files Browse the repository at this point in the history
  • Loading branch information
eben4ya committed Nov 18, 2024
1 parent a610316 commit 491da56
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Appview/Views/TodayOrder.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ public TodayOrder()
DataContext = viewModel;
}

private void ReloadData()
{
// Function to reload data from database
var mainWindow = Application.Current.MainWindow as MainWindow;

if (mainWindow != null)
{
// Make instance from this page
var newPage = new TodayOrder();

// Set main window content to this page
mainWindow.Content = newPage;
}
}

private void Button_Click(object sender, RoutedEventArgs e)
{
var loginPage = new Login();
Expand Down Expand Up @@ -84,6 +99,8 @@ private void Button_Click_Done(object sender, RoutedEventArgs e)
MessageBox.Show("Failed to get order information!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}

ReloadData();
}

}
Expand Down

0 comments on commit 491da56

Please sign in to comment.