diff --git a/FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.Designer.cs b/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs similarity index 82% rename from FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.Designer.cs rename to FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs index cafe392..2d43d3a 100644 --- a/FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.Designer.cs +++ b/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace FlowerShopDatabaseImplement.Migrations { [DbContext(typeof(FlowerShopDataBase))] - [Migration("20240406181124_InitialCreate")] + [Migration("20240422170012_InitialCreate")] partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -115,6 +115,33 @@ namespace FlowerShopDatabaseImplement.Migrations b.ToTable("FlowerComponents"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ImplementerFIO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("WorkExperience") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Implementers"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.Property("Id") @@ -138,6 +165,9 @@ namespace FlowerShopDatabaseImplement.Migrations b.Property("FlowerId") .HasColumnType("int"); + b.Property("ImplementerId") + .HasColumnType("int"); + b.Property("Status") .HasColumnType("int"); @@ -150,6 +180,8 @@ namespace FlowerShopDatabaseImplement.Migrations b.HasIndex("FlowerId"); + b.HasIndex("ImplementerId"); + b.ToTable("Orders"); }); @@ -186,9 +218,15 @@ namespace FlowerShopDatabaseImplement.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.HasOne("FlowerShopDatabaseImplement.Models.Implementer", "Implementer") + .WithMany("Orders") + .HasForeignKey("ImplementerId"); + b.Navigation("Client"); b.Navigation("Flower"); + + b.Navigation("Implementer"); }); modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b => @@ -207,6 +245,11 @@ namespace FlowerShopDatabaseImplement.Migrations b.Navigation("Orders"); }); + + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b => + { + b.Navigation("Orders"); + }); #pragma warning restore 612, 618 } } diff --git a/FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.cs b/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs similarity index 81% rename from FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.cs rename to FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs index b6dd180..60ff657 100644 --- a/FlowerShopDatabaseImplement/Migrations/20240406181124_InitialCreate.cs +++ b/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs @@ -52,6 +52,22 @@ namespace FlowerShopDatabaseImplement.Migrations table.PrimaryKey("PK_Flowers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Implementers", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ImplementerFIO = table.Column(type: "nvarchar(max)", nullable: false), + Password = table.Column(type: "nvarchar(max)", nullable: false), + Qualification = table.Column(type: "int", nullable: false), + WorkExperience = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Implementers", x => x.Id); + }); + migrationBuilder.CreateTable( name: "FlowerComponents", columns: table => new @@ -91,7 +107,8 @@ namespace FlowerShopDatabaseImplement.Migrations DateCreate = table.Column(type: "datetime2", nullable: false), DateImplement = table.Column(type: "datetime2", nullable: true), FlowerId = table.Column(type: "int", nullable: false), - ClientId = table.Column(type: "int", nullable: false) + ClientId = table.Column(type: "int", nullable: false), + ImplementerId = table.Column(type: "int", nullable: true) }, constraints: table => { @@ -108,6 +125,11 @@ namespace FlowerShopDatabaseImplement.Migrations principalTable: "Flowers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Orders_Implementers_ImplementerId", + column: x => x.ImplementerId, + principalTable: "Implementers", + principalColumn: "Id"); }); migrationBuilder.CreateIndex( @@ -129,6 +151,11 @@ namespace FlowerShopDatabaseImplement.Migrations name: "IX_Orders_FlowerId", table: "Orders", column: "FlowerId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_ImplementerId", + table: "Orders", + column: "ImplementerId"); } protected override void Down(MigrationBuilder migrationBuilder) @@ -147,6 +174,9 @@ namespace FlowerShopDatabaseImplement.Migrations migrationBuilder.DropTable( name: "Flowers"); + + migrationBuilder.DropTable( + name: "Implementers"); } } } diff --git a/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs b/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs index 3d9e38f..2fc7426 100644 --- a/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs +++ b/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs @@ -113,6 +113,33 @@ namespace FlowerShopDatabaseImplement.Migrations b.ToTable("FlowerComponents"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ImplementerFIO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("WorkExperience") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Implementers"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.Property("Id") @@ -136,6 +163,9 @@ namespace FlowerShopDatabaseImplement.Migrations b.Property("FlowerId") .HasColumnType("int"); + b.Property("ImplementerId") + .HasColumnType("int"); + b.Property("Status") .HasColumnType("int"); @@ -148,6 +178,8 @@ namespace FlowerShopDatabaseImplement.Migrations b.HasIndex("FlowerId"); + b.HasIndex("ImplementerId"); + b.ToTable("Orders"); }); @@ -184,9 +216,15 @@ namespace FlowerShopDatabaseImplement.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.HasOne("FlowerShopDatabaseImplement.Models.Implementer", "Implementer") + .WithMany("Orders") + .HasForeignKey("ImplementerId"); + b.Navigation("Client"); b.Navigation("Flower"); + + b.Navigation("Implementer"); }); modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b => @@ -205,6 +243,11 @@ namespace FlowerShopDatabaseImplement.Migrations b.Navigation("Orders"); }); + + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Implementer", b => + { + b.Navigation("Orders"); + }); #pragma warning restore 612, 618 } } diff --git a/ProjectFlowerShop/MainForm.Designer.cs b/ProjectFlowerShop/MainForm.Designer.cs index dec827b..3605954 100644 --- a/ProjectFlowerShop/MainForm.Designer.cs +++ b/ProjectFlowerShop/MainForm.Designer.cs @@ -55,7 +55,7 @@ menuStrip1.Items.AddRange(new ToolStripItem[] { ToolStripMenu, отчетыToolStripMenuItem }); menuStrip1.Location = new Point(0, 0); menuStrip1.Name = "menuStrip1"; - menuStrip1.Size = new Size(1296, 28); + menuStrip1.Size = new Size(1422, 28); menuStrip1.TabIndex = 0; menuStrip1.Text = "menuStrip1"; // @@ -69,35 +69,35 @@ // КомпонентыStripMenuItem // КомпонентыStripMenuItem.Name = "КомпонентыStripMenuItem"; - КомпонентыStripMenuItem.Size = new Size(224, 26); + КомпонентыStripMenuItem.Size = new Size(185, 26); КомпонентыStripMenuItem.Text = "Компоненты"; КомпонентыStripMenuItem.Click += КомпонентыStripMenuItem_Click; // // ЦветыStripMenuItem // ЦветыStripMenuItem.Name = "ЦветыStripMenuItem"; - ЦветыStripMenuItem.Size = new Size(224, 26); + ЦветыStripMenuItem.Size = new Size(185, 26); ЦветыStripMenuItem.Text = "Цветы"; ЦветыStripMenuItem.Click += ЦветыStripMenuItem_Click; // // клиентыToolStripMenuItem // клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; - клиентыToolStripMenuItem.Size = new Size(224, 26); + клиентыToolStripMenuItem.Size = new Size(185, 26); клиентыToolStripMenuItem.Text = "Клиенты"; клиентыToolStripMenuItem.Click += клиентыToolStripMenuItem_Click; // // исполнителиToolStripMenuItem // исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem"; - исполнителиToolStripMenuItem.Size = new Size(224, 26); + исполнителиToolStripMenuItem.Size = new Size(185, 26); исполнителиToolStripMenuItem.Text = "Исполнители"; исполнителиToolStripMenuItem.Click += исполнителиToolStripMenuItem_Click; // // стартРаботToolStripMenuItem // стартРаботToolStripMenuItem.Name = "стартРаботToolStripMenuItem"; - стартРаботToolStripMenuItem.Size = new Size(224, 26); + стартРаботToolStripMenuItem.Size = new Size(185, 26); стартРаботToolStripMenuItem.Text = "Старт работ"; стартРаботToolStripMenuItem.Click += стартРаботToolStripMenuItem_Click; // @@ -135,12 +135,12 @@ DataGridView.Location = new Point(12, 31); DataGridView.Name = "DataGridView"; DataGridView.RowHeadersWidth = 51; - DataGridView.Size = new Size(1007, 407); + DataGridView.Size = new Size(1133, 407); DataGridView.TabIndex = 1; // // CreateOrderButton // - CreateOrderButton.Location = new Point(1025, 31); + CreateOrderButton.Location = new Point(1151, 31); CreateOrderButton.Name = "CreateOrderButton"; CreateOrderButton.Size = new Size(259, 29); CreateOrderButton.TabIndex = 2; @@ -150,7 +150,7 @@ // // TakeInWorkButton // - TakeInWorkButton.Location = new Point(1025, 66); + TakeInWorkButton.Location = new Point(1151, 66); TakeInWorkButton.Name = "TakeInWorkButton"; TakeInWorkButton.Size = new Size(259, 29); TakeInWorkButton.TabIndex = 3; @@ -160,7 +160,7 @@ // // ReadyButton // - ReadyButton.Location = new Point(1025, 101); + ReadyButton.Location = new Point(1151, 101); ReadyButton.Name = "ReadyButton"; ReadyButton.Size = new Size(259, 29); ReadyButton.TabIndex = 4; @@ -170,7 +170,7 @@ // // IssuedButton // - IssuedButton.Location = new Point(1025, 136); + IssuedButton.Location = new Point(1151, 136); IssuedButton.Name = "IssuedButton"; IssuedButton.Size = new Size(259, 29); IssuedButton.TabIndex = 5; @@ -180,7 +180,7 @@ // // RefreshButton // - RefreshButton.Location = new Point(1025, 171); + RefreshButton.Location = new Point(1151, 171); RefreshButton.Name = "RefreshButton"; RefreshButton.Size = new Size(259, 29); RefreshButton.TabIndex = 6; @@ -192,7 +192,7 @@ // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1296, 450); + ClientSize = new Size(1422, 450); Controls.Add(RefreshButton); Controls.Add(IssuedButton); Controls.Add(ReadyButton); diff --git a/ProjectFlowerShop/MainForm.cs b/ProjectFlowerShop/MainForm.cs index 2d10b9d..cfe5499 100644 --- a/ProjectFlowerShop/MainForm.cs +++ b/ProjectFlowerShop/MainForm.cs @@ -58,6 +58,7 @@ namespace ProjectFlowerShop DataGridView.DataSource = list; DataGridView.Columns["FlowerId"].Visible = false; DataGridView.Columns["ClientId"].Visible = false; + DataGridView.Columns["ImplementerId"].Visible = false; DataGridView.Columns["FlowerName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } _logger.LogInformation("Загрузка заказов");