diff --git a/SecuritySystem/FormMain.Designer.cs b/SecuritySystem/FormMain.Designer.cs
index f00b9f4..9a72e08 100644
--- a/SecuritySystem/FormMain.Designer.cs
+++ b/SecuritySystem/FormMain.Designer.cs
@@ -90,7 +90,7 @@
//
componentListToolStripMenuItem.Name = "componentListToolStripMenuItem";
componentListToolStripMenuItem.Size = new Size(218, 22);
- componentListToolStripMenuItem.Text = "Список Компонентов";
+ componentListToolStripMenuItem.Text = "Список изделий";
componentListToolStripMenuItem.Click += ComponentListToolStripMenuItem_Click;
//
// componentsSecureToolStripMenuItem
diff --git a/SecuritySystem/FormReportOrders.cs b/SecuritySystem/FormReportOrders.cs
index 8bdaf19..ef90da6 100644
--- a/SecuritySystem/FormReportOrders.cs
+++ b/SecuritySystem/FormReportOrders.cs
@@ -74,6 +74,7 @@ namespace SecuritySystemView
{
try
{
+ System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
_logic.SaveOrdersToPdfFile(new ReportBindingModel
{
FileName = dialog.FileName,
diff --git a/SecuritySystem/ReportOrders.rdlc b/SecuritySystem/ReportOrders.rdlc
index a3a414a..32a88fb 100644
--- a/SecuritySystem/ReportOrders.rdlc
+++ b/SecuritySystem/ReportOrders.rdlc
@@ -1,599 +1,610 @@
- 0
-
-
-
- System.Data.DataSet
- /* Local Connection */
-
- 10791c83-cee8-4a38-bbd0-245fc17cefb3
-
-
-
-
-
- SecureCompanyContractsViewModels
- /* Local Query */
-
-
-
- Id
- System.Int32
-
-
- DateCreate
- System.DateTime
-
-
- SecureName
- System.String
-
-
- Sum
- System.Decimal
-
-
- Status
- System.String
-
-
-
- SecureCompanyContracts.ViewModels
- ReportOrdersViewModel
- SecureCompanyContracts.ViewModels.ReportOrdersViewModel, SecureCompanyContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- Заказы
-
-
-
-
-
-
- 0.89986cm
- 17.23759cm
-
-
- Middle
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
- true
- true
-
-
-
-
- =Parameters!ReportParameterPeriod.Value
-
-
-
-
-
-
- ReportParameterPeriod
- 0.89986cm
- 0.9175cm
- 17.23759cm
- 1
-
-
- Middle
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
- 2.07073cm
-
-
- 2.88212cm
-
-
- 5.97364cm
-
-
- 3.14082cm
-
-
- 2.5cm
-
-
-
-
- 0.6cm
-
-
-
-
- true
- true
-
-
-
-
- Номер
-
-
-
-
-
-
- Textbox3
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- Дата создания
-
-
-
-
-
-
- Textbox5
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- Поездка
-
-
-
-
-
-
- Textbox7
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- Статус
-
-
-
-
-
-
- Textbox9
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- Сумма
-
-
-
-
-
-
- Textbox1
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- 0.6cm
-
-
-
-
- true
- true
-
-
-
-
- =Fields!Id.Value
-
-
-
-
-
-
- Id
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- =Fields!DateCreate.Value
-
-
-
-
-
-
- DateCreate
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- =Fields!SecureName.Value
-
-
-
-
-
-
- SecureName
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- =Fields!Status.Value
-
-
-
-
-
-
- Status
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
- true
- true
-
-
-
-
- =Fields!Sum.Value
-
-
-
-
-
-
- Sum1
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- After
-
-
-
-
-
-
- DataSetOrders
- 1.99375cm
- 0.33514cm
- 1.2cm
- 16.56731cm
- 2
-
-
-
-
-
- true
- true
-
-
-
-
- =Sum(Fields!Sum.Value, "DataSetOrders")
-
-
-
-
-
-
- Textbox11
- 3.60398cm
- 13.76163cm
- 0.6cm
- 3.14082cm
- 3
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
- true
- true
-
-
-
-
- Итого:
-
-
-
-
-
-
- Textbox12
- 3.60398cm
- 11.52621cm
- 0.6cm
- 2.23542cm
- 4
-
-
- Middle
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
- 2in
-
-
- 6.79848in
-
- 29.7cm
- 21cm
- 2cm
- 2cm
- 2cm
- 2cm
- 0.13cm
-
-
-
-
-
-
- String
- ReportParameter1
-
-
-
-
- 4
- 2
-
-
- 0
- 0
- ReportParameterPeriod
-
-
-
-
- Cm
- 116538ba-4171-47d5-8818-2dd89f8445b0
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 10791c83-cee8-4a38-bbd0-245fc17cefb3
+
+
+
+
+
+ SecureCompanyContractsViewModels
+ /* Local Query */
+
+
+
+ Id
+ System.Int32
+
+
+ DateCreate
+ System.DateTime
+
+
+ SecureName
+ System.String
+
+
+ Sum
+ System.Decimal
+
+
+ Status
+ System.String
+
+
+
+ SecureCompanyContracts.ViewModels
+ ReportOrdersViewModel
+ SecureCompanyContracts.ViewModels.ReportOrdersViewModel, SecureCompanyContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Заказы
+
+
+
+
+
+
+ 0.89986cm
+ 17.23759cm
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ReportParameterPeriod.Value
+
+
+
+
+
+
+ ReportParameterPeriod
+ 0.89986cm
+ 0.9175cm
+ 17.23759cm
+ 1
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 2.07073cm
+
+
+ 2.88212cm
+
+
+ 5.97364cm
+
+
+ 3.14082cm
+
+
+ 2.5cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Номер
+
+
+
+
+
+
+ Textbox3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата создания
+
+
+
+
+
+
+ Textbox5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Изделие
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textbox7
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Статус
+
+
+
+
+
+
+ Textbox9
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Id.Value
+
+
+
+
+
+
+ Id
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!SecureName.Value
+
+
+
+
+
+
+ SecureName
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Status.Value
+
+
+
+
+
+
+ Status
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Sum.Value
+
+
+
+
+
+
+ Sum1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ DataSetOrders
+ 1.99375cm
+ 0.33514cm
+ 1.2cm
+ 16.56731cm
+ 2
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!Sum.Value, "DataSetOrders")
+
+
+
+
+
+
+ Textbox11
+ 3.60398cm
+ 13.76163cm
+ 0.6cm
+ 3.14082cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Итого:
+
+
+
+
+
+
+ Textbox12
+ 3.60398cm
+ 11.52621cm
+ 0.6cm
+ 2.23542cm
+ 4
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 2in
+
+
+ 6.79848in
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ ReportParameter1
+
+
+
+
+ 4
+ 2
+
+
+ 0
+ 0
+ ReportParameterPeriod
+
+
+
+
+ Cm
+ 116538ba-4171-47d5-8818-2dd89f8445b0
\ No newline at end of file
diff --git a/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs b/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs
index fb7d5e1..e5a68b4 100644
--- a/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs
+++ b/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs
@@ -87,8 +87,8 @@ namespace SecureCompanyBusinessLogic.BusinessLogics
_saveToWord.CreateDoc(new WordInfo
{
FileName = model.FileName,
- Title = "Список компонент",
- Secures = _Securestorage.GetFullList()
+ Title = "Список изделий",
+ Secures = _SecureStorage.GetFullList()
});
}
@@ -101,7 +101,7 @@ namespace SecureCompanyBusinessLogic.BusinessLogics
_saveToExcel.CreateReport(new ExcelInfo
{
FileName = model.FileName,
- Title = "Список компонент",
+ Title = "Список изделий-компонентов",
SecureComponents = GetSecureComponent()
});
}
diff --git a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs
index f9c945d..cef5f59 100644
--- a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs
+++ b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.Designer.cs
@@ -12,8 +12,13 @@ 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 f262b4a..636f4e5 100644
--- a/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs
+++ b/SecuritySystemDatabaseImplement/Migrations/20230423054524_with client.cs
@@ -7,7 +7,11 @@ 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
new file mode 100644
index 0000000..cef5f59
--- /dev/null
+++ b/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.Designer.cs
@@ -0,0 +1,219 @@
+//
+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
new file mode 100644
index 0000000..636f4e5
--- /dev/null
+++ b/SecuritySystemDatabaseImplement/Migrations/20230502080047_lab4.cs
@@ -0,0 +1,160 @@
+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");
+ }
+ }
+}