From 1fc4b50dba6532e239c75bb73e5d39cc1e0b6720 Mon Sep 17 00:00:00 2001 From: eben4ya Date: Mon, 18 Nov 2024 02:35:02 +0700 Subject: [PATCH] --- Appview/Views/FoodDetails.xaml.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Appview/Views/FoodDetails.xaml.cs b/Appview/Views/FoodDetails.xaml.cs index 0fd5ac0..413608d 100644 --- a/Appview/Views/FoodDetails.xaml.cs +++ b/Appview/Views/FoodDetails.xaml.cs @@ -24,17 +24,21 @@ public partial class FoodDetails : UserControl { private int _productId; private int _stock; + private string _productName; + private string _productDesc; public FoodDetails(int productId, string Title, decimal Price, int Stock, DateTime Expired, string Description) { InitializeComponent(); DataContext = new GetProductFromDB(); _productId = productId; + _productName = Title; + _productDesc = Description; ContentTitle.Text = Title; + ContentDescription.Text = Description; ContentPrice.Text = Price.ToString(); ContentStock.Text = Stock.ToString(); ContentExpiry.Text = Expired.ToString(); - ContentDescription.Text = Description; _stock = Stock; } @@ -67,7 +71,7 @@ private void Pesan_Click(object sender, RoutedEventArgs e) { //MessageBox.Show("Button clicked successfully!", "Notification", MessageBoxButton.OK, MessageBoxImage.Information); // Create an instance of FoodDetails page - var paymentPage = new Payment(quantity, price, _productId); + var paymentPage = new Payment(quantity, price, _productId, _productName, _productDesc); // Get the main window and set its content to the new page var mainWindow = Application.Current.MainWindow as MainWindow;