diff --git a/Demka-2/Use/Conector.cs b/Demka-2/Use/Conector.cs
index cf22e39..dd5cce5 100644
--- a/Demka-2/Use/Conector.cs
+++ b/Demka-2/Use/Conector.cs
@@ -8,6 +8,6 @@ public class AppDbContext : DbContext
protected override void OnConfiguring(DbContextOptionsBuilder oB)
{
- oB.UseSqlServer("Host=45.67.56.214;Port=5421;Username=user16;Password=dZ28IVE5;Database=user16");
+ oB.UseSqlServer("Server=45.67.56.214,5421;Database=user16;User Id=user16;Password=dZ28IVE5;");
}
}
\ No newline at end of file
diff --git a/Demka-2/Use/Service.cs b/Demka-2/Use/Service.cs
index d7d2402..9a690a6 100644
--- a/Demka-2/Use/Service.cs
+++ b/Demka-2/Use/Service.cs
@@ -1,8 +1,10 @@
using System;
+using System.ComponentModel.DataAnnotations;
namespace Demka_2.Use;
public class Service
{
+ [Key]
public Guid guid { get; set; }
public string Name { get; set; }
public string ImagePath { get; set; }
diff --git a/Demka-2/Views/MainWindow.axaml b/Demka-2/Views/MainWindow.axaml
index 89dce4b..0b1cdac 100644
--- a/Demka-2/Views/MainWindow.axaml
+++ b/Demka-2/Views/MainWindow.axaml
@@ -15,11 +15,11 @@
-
-
-
-
+
+
+
+
@@ -28,7 +28,7 @@
-
+
@@ -47,6 +47,6 @@
-
+
\ No newline at end of file
diff --git a/Demka-2/Views/MainWindow.axaml.cs b/Demka-2/Views/MainWindow.axaml.cs
index d7ba665..f240670 100644
--- a/Demka-2/Views/MainWindow.axaml.cs
+++ b/Demka-2/Views/MainWindow.axaml.cs
@@ -5,6 +5,7 @@ using System.Linq;
using Demka_2.Use;
using System;
using Avalonia.Interactivity;
+using DynamicData;
namespace Demka_2.Views;
@@ -70,7 +71,7 @@ public partial class MainWindow : Window
private void LoadServices()
{
- using (var context = new AppDbContext())
+ /*using (var context = new AppDbContext())
{
var services = context.Services.ToList();
foreach (var service in services)
@@ -78,7 +79,29 @@ public partial class MainWindow : Window
Services.Add(service);
}
- }
+ }*/
+
+ 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 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+ Services.Add(new Service { Name = "Услуга 3", Price = 150, Duration = 45, Discount = 20 });
+
}
private void UpdateFilteredServices()