From 3c0410d83a167fb72203990265605a1d860ee47d Mon Sep 17 00:00:00 2001 From: Userok Date: Fri, 27 Dec 2024 11:59:46 +0300 Subject: [PATCH] --- Demka-2/Views/MainWindow.axaml.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Demka-2/Views/MainWindow.axaml.cs b/Demka-2/Views/MainWindow.axaml.cs index c99c34b..2edfbf7 100644 --- a/Demka-2/Views/MainWindow.axaml.cs +++ b/Demka-2/Views/MainWindow.axaml.cs @@ -39,9 +39,14 @@ public partial class MainWindow : Window private void LoadServices() { - Services.Add(new Service { Name = "Услуга 1", Price = 100, Duration = 30, Discount = 0 }); - Services.Add(new Service { Name = "Услуга 2", Price = 200, Duration = 60, Discount = 10 }); - Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 }); + using (var context = new AppDbContext()) + { + var services = context.Services.ToList(); + foreach (var service in services) + { + Services.Add(service); + } + } } private void UpdateFilteredServices()