From 298ef2bdb6b9268b6b489fd88c448d9152c40a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?10=D0=93=20=D0=95=D0=B3=D0=BE=D1=80=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Tue, 2 May 2023 13:25:14 +0400 Subject: [PATCH] fix --- SecuritySystem/Program.cs | 4 - .../BusinessLogics/ReportLogic.cs | 6 +- .../20230423054524_with client.Designer.cs | 6 +- .../Migrations/20230423054524_with client.cs | 6 +- .../20230502080047_lab4.Designer.cs | 219 ------------------ .../Migrations/20230502080047_lab4.cs | 160 ------------- .../SecuritySystemDatabase.cs | 2 +- .../Implements/ClientStorage.cs | 2 +- .../Implements/ClientStorage.cs | 2 +- 9 files changed, 8 insertions(+), 399 deletions(-) delete mode 100644 SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs delete mode 100644 SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs diff --git a/SecuritySystem/Program.cs b/SecuritySystem/Program.cs index 956e129..bfe912e 100644 --- a/SecuritySystem/Program.cs +++ b/SecuritySystem/Program.cs @@ -9,10 +9,6 @@ using SecuritySystemDatabaseImplement.Implements; using SecuritySystemContracts.BusinessLogicsContracts; using SecuritySystemContracts.StoragesContracts; using SecureCompanyBusinessLogic.BusinessLogics; -using SecuritySystemBusinessLogic.BusinessLogics; -using SecuritySystemContracts.BusinessLogicsContracts; -using SecuritySystemContracts.StorageContracts; -using SecuritySystemView; namespace SecuritySystemView { diff --git a/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs b/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs index e5a68b4..43f1ac8 100644 --- a/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs @@ -11,7 +11,7 @@ namespace SecureCompanyBusinessLogic.BusinessLogics public class ReportLogic : IReportLogic { private readonly IComponentStorage _componentStorage; - private readonly ISecureStorage _Securestorage; + private readonly ISecureStorage _SecureStorage; private readonly IOrderStorage _orderStorage; private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; @@ -19,7 +19,7 @@ namespace SecureCompanyBusinessLogic.BusinessLogics public ReportLogic(ISecureStorage Securestorage, IComponentStorage componentStorage, IOrderStorage orderStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { - _Securestorage = Securestorage; + _SecureStorage = Securestorage; _componentStorage = componentStorage; _orderStorage = orderStorage; _saveToExcel = saveToExcel; @@ -34,7 +34,7 @@ namespace SecureCompanyBusinessLogic.BusinessLogics public List GetSecureComponent() { var components = _componentStorage.GetFullList(); - var Secures = _Securestorage.GetFullList(); + var Secures = _SecureStorage.GetFullList(); var list = new List(); foreach (var Secure in Secures) diff --git a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs index cef5f59..ad3743a 100644 --- a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs +++ b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs @@ -12,13 +12,9 @@ using SecuritySystemDatabaseImplement; namespace SecuritySystemDatabaseImplement.Migrations { [DbContext(typeof(SecuritySystemDatabase))] -<<<<<<<< HEAD:SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs + [Migration("20230423054524_with client")] partial class withclient -======== - [Migration("20230502080047_lab4")] - partial class lab4 ->>>>>>>> origin/Lab_Work_4:SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs index 636f4e5..4c41e93 100644 --- a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs +++ b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs @@ -6,12 +6,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace SecuritySystemDatabaseImplement.Migrations { - /// -<<<<<<<< HEAD:SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs + public partial class withclient : Migration -======== - public partial class lab4 : Migration ->>>>>>>> origin/Lab_Work_4:SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs { /// protected override void Up(MigrationBuilder migrationBuilder) diff --git a/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs b/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs deleted file mode 100644 index cef5f59..0000000 --- a/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs +++ /dev/null @@ -1,219 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SecuritySystemDatabaseImplement; - -#nullable disable - -namespace SecuritySystemDatabaseImplement.Migrations -{ - [DbContext(typeof(SecuritySystemDatabase))] -<<<<<<<< HEAD:SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs - [Migration("20230423054524_with client")] - partial class withclient -======== - [Migration("20230502080047_lab4")] - partial class lab4 ->>>>>>>> origin/Lab_Work_4:SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("text"); - - b.Property("Email") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Cost") - .HasColumnType("double precision"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("DateCreate") - .HasColumnType("timestamp with time zone"); - - b.Property("DateImplement") - .HasColumnType("timestamp with time zone"); - - b.Property("SecureId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("Sum") - .HasColumnType("double precision"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("SecureId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Secure", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("double precision"); - - b.Property("SecureName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Secures"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.SecureComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("integer"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("SecureId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("SecureId"); - - b.ToTable("SecureComponents"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Order", b => - { - b.HasOne("SecuritySystemDatabaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SecuritySystemDatabaseImplement.Models.Secure", "Secure") - .WithMany("Orders") - .HasForeignKey("SecureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Secure"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.SecureComponent", b => - { - b.HasOne("SecuritySystemDatabaseImplement.Models.Component", "Component") - .WithMany("SecureComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SecuritySystemDatabaseImplement.Models.Secure", "Secure") - .WithMany("Components") - .HasForeignKey("SecureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Secure"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Component", b => - { - b.Navigation("SecureComponents"); - }); - - modelBuilder.Entity("SecuritySystemDatabaseImplement.Models.Secure", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs b/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs deleted file mode 100644 index 636f4e5..0000000 --- a/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace SecuritySystemDatabaseImplement.Migrations -{ - /// -<<<<<<<< HEAD:SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs - public partial class withclient : Migration -======== - public partial class lab4 : Migration ->>>>>>>> origin/Lab_Work_4:SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ClientFIO = table.Column(type: "text", nullable: false), - Email = table.Column(type: "text", nullable: false), - Password = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Components", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ComponentName = table.Column(type: "text", nullable: false), - Cost = table.Column(type: "double precision", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Components", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Secures", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SecureName = table.Column(type: "text", nullable: false), - Price = table.Column(type: "double precision", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Secures", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SecureId = table.Column(type: "integer", nullable: false), - ClientId = table.Column(type: "integer", nullable: false), - Count = table.Column(type: "integer", nullable: false), - Sum = table.Column(type: "double precision", nullable: false), - Status = table.Column(type: "integer", nullable: false), - DateCreate = table.Column(type: "timestamp with time zone", nullable: false), - DateImplement = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Clients_ClientId", - column: x => x.ClientId, - principalTable: "Clients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Orders_Secures_SecureId", - column: x => x.SecureId, - principalTable: "Secures", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "SecureComponents", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SecureId = table.Column(type: "integer", nullable: false), - ComponentId = table.Column(type: "integer", nullable: false), - Count = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_SecureComponents", x => x.Id); - table.ForeignKey( - name: "FK_SecureComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_SecureComponents_Secures_SecureId", - column: x => x.SecureId, - principalTable: "Secures", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_SecureId", - table: "Orders", - column: "SecureId"); - - migrationBuilder.CreateIndex( - name: "IX_SecureComponents_ComponentId", - table: "SecureComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_SecureComponents_SecureId", - table: "SecureComponents", - column: "SecureId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "SecureComponents"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Secures"); - } - } -} diff --git a/SecuritySystemDatabaseImplement/SecuritySystemDatabase.cs b/SecuritySystemDatabaseImplement/SecuritySystemDatabase.cs index d1e71d7..c99b209 100644 --- a/SecuritySystemDatabaseImplement/SecuritySystemDatabase.cs +++ b/SecuritySystemDatabaseImplement/SecuritySystemDatabase.cs @@ -9,7 +9,7 @@ namespace SecuritySystemDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=SecuritySystemDatabaseFull;Username=postgres;Password=1953"); + optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=SecuritySystemDatabaseFull5;Username=postgres;Password=1953"); } base.OnConfiguring(optionsBuilder); } diff --git a/SecuritySystemFileImplement/Implements/ClientStorage.cs b/SecuritySystemFileImplement/Implements/ClientStorage.cs index 11e5bab..54ccb7d 100644 --- a/SecuritySystemFileImplement/Implements/ClientStorage.cs +++ b/SecuritySystemFileImplement/Implements/ClientStorage.cs @@ -1,6 +1,6 @@ using SecuritySystemContracts.BindingModels; using SecuritySystemContracts.SearchModels; -using SecuritySystemContracts.StorageContracts; +using SecuritySystemContracts.StoragesContracts; using SecuritySystemContracts.ViewModels; using SecuritySystemFileImplement.Models; using System; diff --git a/SecuritySystemListImplement/Implements/ClientStorage.cs b/SecuritySystemListImplement/Implements/ClientStorage.cs index da94d79..48b1227 100644 --- a/SecuritySystemListImplement/Implements/ClientStorage.cs +++ b/SecuritySystemListImplement/Implements/ClientStorage.cs @@ -1,6 +1,6 @@ using SecuritySystemContracts.BindingModels; using SecuritySystemContracts.SearchModels; -using SecuritySystemContracts.StorageContracts; +using SecuritySystemContracts.StoragesContracts; using SecuritySystemContracts.ViewModels; using SecuritySystemListImplement.Models;