From 7a5d3f79820d6597cc3eb76135e078e3a0dff6af Mon Sep 17 00:00:00 2001 From: aleksandr chegodaev Date: Sun, 16 Jun 2024 21:11:56 +0400 Subject: [PATCH] lab5 ispr --- .../LawFirmClientApp/Models/ErrorViewModel.cs | 2 +- .../Views/Shared/_Layout.cshtml | 88 +++---- LawFirm/LawFirmClientApp/appsettings.json | 3 +- .../20240510201130_InitialCreate.Designer.cs | 218 ------------------ .../20240510201130_InitialCreate.cs | 155 ------------- .../LawFirmDataBaseModelSnapshot.cs | 211 ----------------- 6 files changed, 49 insertions(+), 628 deletions(-) delete mode 100644 LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.Designer.cs delete mode 100644 LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.cs delete mode 100644 LawFirm/LawFirmDatabaseImplement/Migrations/LawFirmDataBaseModelSnapshot.cs diff --git a/LawFirm/LawFirmClientApp/Models/ErrorViewModel.cs b/LawFirm/LawFirmClientApp/Models/ErrorViewModel.cs index 22cf6e1..bb61cda 100644 --- a/LawFirm/LawFirmClientApp/Models/ErrorViewModel.cs +++ b/LawFirm/LawFirmClientApp/Models/ErrorViewModel.cs @@ -6,4 +6,4 @@ namespace LawFirmClientApp.Models public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } -} +} \ No newline at end of file diff --git a/LawFirm/LawFirmClientApp/Views/Shared/_Layout.cshtml b/LawFirm/LawFirmClientApp/Views/Shared/_Layout.cshtml index 9182009..367efd0 100644 --- a/LawFirm/LawFirmClientApp/Views/Shared/_Layout.cshtml +++ b/LawFirm/LawFirmClientApp/Views/Shared/_Layout.cshtml @@ -1,49 +1,53 @@  - - - @ViewData["Title"] - LawFirmClientApp - - - + + +@ViewData["Title"] - AbstractShowClientApp + + + + -
- -
-
-
- @RenderBody() -
-
- - - - - - @await RenderSectionAsync("Scripts", required: false) +
+ +
+
+
+ @RenderBody() +
+
+ + + @RenderSection("Scripts", required: false) diff --git a/LawFirm/LawFirmClientApp/appsettings.json b/LawFirm/LawFirmClientApp/appsettings.json index 10f68b8..aab68cc 100644 --- a/LawFirm/LawFirmClientApp/appsettings.json +++ b/LawFirm/LawFirmClientApp/appsettings.json @@ -5,5 +5,6 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "IPAddress": "http://localhost:5134/" } diff --git a/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.Designer.cs b/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.Designer.cs deleted file mode 100644 index a737f36..0000000 --- a/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.Designer.cs +++ /dev/null @@ -1,218 +0,0 @@ -// -using System; -using LawFirmDatabaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace LawFirmDatabaseImplement.Migrations -{ - [DbContext(typeof(LawFirmDatabase))] -<<<<<<<< HEAD:LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.Designer.cs - [Migration("20240510201130_InitialCreate")] -======== - [Migration("20240616165923_InitialCreate")] ->>>>>>>> lab4:LawFirm/LawFirmDatabaseImplement/Migrations/20240616165923_InitialCreate.Designer.cs - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Cost") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DocumentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Price") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Documents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.DocumentComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DocumentId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("DocumentId"); - - b.ToTable("DocumentComponents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DateCreate") - .HasColumnType("datetime2"); - - b.Property("DateImplement") - .HasColumnType("datetime2"); - - b.Property("DocumentId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("DocumentId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.DocumentComponent", b => - { - b.HasOne("LawFirmDatabaseImplement.Models.Component", "Component") - .WithMany("DocumentComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("LawFirmDatabaseImplement.Models.Document", "Document") - .WithMany("Components") - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Document"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Order", b => - { - b.HasOne("LawFirmDatabaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("LawFirmDatabaseImplement.Models.Document", "Document") - .WithMany("Orders") - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Document"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Component", b => - { - b.Navigation("DocumentComponents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Document", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.cs b/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.cs deleted file mode 100644 index 14566b7..0000000 --- a/LawFirm/LawFirmDatabaseImplement/Migrations/20240510201130_InitialCreate.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace LawFirmDatabaseImplement.Migrations -{ - /// - public partial class InitialCreate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ClientFIO = table.Column(type: "nvarchar(max)", nullable: false), - Email = table.Column(type: "nvarchar(max)", nullable: false), - Password = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Components", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ComponentName = table.Column(type: "nvarchar(max)", nullable: false), - Cost = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Components", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Documents", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DocumentName = table.Column(type: "nvarchar(max)", nullable: false), - Price = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Documents", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "DocumentComponents", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DocumentId = table.Column(type: "int", nullable: false), - ComponentId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DocumentComponents", x => x.Id); - table.ForeignKey( - name: "FK_DocumentComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_DocumentComponents_Documents_DocumentId", - column: x => x.DocumentId, - principalTable: "Documents", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DocumentId = table.Column(type: "int", nullable: false), - ClientId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false), - Sum = table.Column(type: "float", nullable: false), - Status = table.Column(type: "int", nullable: false), - DateCreate = table.Column(type: "datetime2", nullable: false), - DateImplement = table.Column(type: "datetime2", 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_Documents_DocumentId", - column: x => x.DocumentId, - principalTable: "Documents", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_DocumentComponents_ComponentId", - table: "DocumentComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_DocumentComponents_DocumentId", - table: "DocumentComponents", - column: "DocumentId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_DocumentId", - table: "Orders", - column: "DocumentId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "DocumentComponents"); - - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Documents"); - } - } -} diff --git a/LawFirm/LawFirmDatabaseImplement/Migrations/LawFirmDataBaseModelSnapshot.cs b/LawFirm/LawFirmDatabaseImplement/Migrations/LawFirmDataBaseModelSnapshot.cs deleted file mode 100644 index 53d33b0..0000000 --- a/LawFirm/LawFirmDatabaseImplement/Migrations/LawFirmDataBaseModelSnapshot.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using LawFirmDatabaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace LawFirmDatabaseImplement.Migrations -{ - [DbContext(typeof(LawFirmDatabase))] - partial class LawFirmDatabaseModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Cost") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DocumentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Price") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Documents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.DocumentComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DocumentId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("DocumentId"); - - b.ToTable("DocumentComponents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DateCreate") - .HasColumnType("datetime2"); - - b.Property("DateImplement") - .HasColumnType("datetime2"); - - b.Property("DocumentId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("DocumentId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.DocumentComponent", b => - { - b.HasOne("LawFirmDatabaseImplement.Models.Component", "Component") - .WithMany("DocumentComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("LawFirmDatabaseImplement.Models.Document", "Document") - .WithMany("Components") - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Document"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Order", b => - { - b.HasOne("LawFirmDatabaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("LawFirmDatabaseImplement.Models.Document", "Document") - .WithMany("Orders") - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Document"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Component", b => - { - b.Navigation("DocumentComponents"); - }); - - modelBuilder.Entity("LawFirmDatabaseImplement.Models.Document", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -}