From 577612af5e5a5953ab4cbc223585578e2bfce779 Mon Sep 17 00:00:00 2001 From: studen Date: Tue, 4 Feb 2025 15:40:01 +0300 Subject: [PATCH] Pravki --- Hardik/Conect/Conector.cs | 22 +- MainWindow.axaml | 4 +- bin/Debug/net8.0/Demka_Snova_1.deps.json | 1036 ++++++++++++++++- bin/Debug/net8.0/Demka_Snova_1.dll | Bin 28672 -> 31744 bytes bin/Debug/net8.0/Demka_Snova_1.pdb | Bin 16900 -> 19424 bytes .../net8.0/Demka_Snova_1.runtimeconfig.json | 1 + bin/Debug/net8.0/System.IO.Pipelines.dll | Bin 77984 -> 77608 bytes obj/Debug/net8.0/Avalonia/Demka_Snova_1.dll | Bin 28672 -> 31744 bytes obj/Debug/net8.0/Avalonia/Demka_Snova_1.pdb | Bin 16900 -> 19424 bytes obj/Debug/net8.0/Avalonia/references | 40 +- obj/Debug/net8.0/Avalonia/resources | Bin 2652 -> 2720 bytes .../net8.0/Demka_Snova_1.AssemblyInfo.cs | 2 +- .../Demka_Snova_1.AssemblyInfoInputs.cache | 2 +- ...mka_Snova_1.csproj.CoreCompileInputs.cache | 2 +- .../Demka_Snova_1.csproj.FileListAbsolute.txt | 55 + obj/Debug/net8.0/Demka_Snova_1.dll | Bin 16384 -> 19456 bytes .../Demka_Snova_1.genruntimeconfig.cache | 2 +- obj/Debug/net8.0/Demka_Snova_1.pdb | Bin 16480 -> 18900 bytes obj/Debug/net8.0/ref/Demka_Snova_1.dll | Bin 9216 -> 9728 bytes .../net8.0/refint/Avalonia/Demka_Snova_1.dll | Bin 9216 -> 9728 bytes obj/Debug/net8.0/refint/Demka_Snova_1.dll | Bin 9728 -> 10752 bytes 21 files changed, 1144 insertions(+), 22 deletions(-) diff --git a/Hardik/Conect/Conector.cs b/Hardik/Conect/Conector.cs index e65c7f0..c6c8711 100644 --- a/Hardik/Conect/Conector.cs +++ b/Hardik/Conect/Conector.cs @@ -4,10 +4,26 @@ namespace Demka_Snova_1.Hardik.Conect; public class AppDbContext : DbContext { - public DbSet sotrudnik { get; set; } - protected override void OnConfiguring(DbContextOptionsBuilder oB) { - oB.UseSqlServer("Hoi"); + oB.UseSqlServer("Host=45.67.56.214;Port=5421;Username=user16;Password=dZ28IVE5;Database=user16"); } + public DbSet sotrudnik { get; set; } + public DbSet uslugi { get; set; } + public DbSet orders { get; set; } + public DbSet klient { get; set; } + + protected override void OnModelCreating(ModelBuilder mb) + { + mb.Entity().HasKey(klient => klient.Code); + mb.Entity().Property(klient => klient.Code).ValueGeneratedOnAdd(); + + mb.Entity().HasKey(orders => orders.ID); + mb.Entity().Property(orders => orders.ID).ValueGeneratedOnAdd(); + + mb.Entity().HasKey(uslugi => uslugi.ID); + + mb.Entity().HasKey(sotrudnik => sotrudnik.ID); + } + } \ No newline at end of file diff --git a/MainWindow.axaml b/MainWindow.axaml index 799ae6c..d9e487d 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -11,8 +11,8 @@ -