From 5f09122350dfb4d899f7b7baee78b22b71980921 Mon Sep 17 00:00:00 2001 From: artiogf Date: Thu, 9 Mar 2023 11:59:25 +0400 Subject: [PATCH] Lab3_Main --- CarpentryWorkshopDatabaseImplement/Models/Order.cs | 12 ++++++++---- CarpentryWorkshopView/FormComponents.Designer.cs | 2 +- CarpentryWorkshopView/FormWoodComponent.Designer.cs | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CarpentryWorkshopDatabaseImplement/Models/Order.cs b/CarpentryWorkshopDatabaseImplement/Models/Order.cs index dd7746f..9b61b18 100644 --- a/CarpentryWorkshopDatabaseImplement/Models/Order.cs +++ b/CarpentryWorkshopDatabaseImplement/Models/Order.cs @@ -2,21 +2,25 @@ using CarpentryWorkshopContracts.ViewModels; using CarpentryWorkshopDataModels.Enums; using CarpentryWorkshopDataModels.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace CarpentryWorkshopDatabaseImplement.Models { public class Order : IOrderModel { public int Id { get; set; } + [ForeignKey("WoodId")] public int WoodId { get; set; } + [Required] public string WoodName { get; set; } = string.Empty; - + [Required] public int Count { get; set; } - + [Required] public double Sum { get; set; } - + [Required] public OrderStatus Status { get; set; } - + [Required] public DateTime DateCreate { get; set; } public DateTime? DateImplement { get; set; } diff --git a/CarpentryWorkshopView/FormComponents.Designer.cs b/CarpentryWorkshopView/FormComponents.Designer.cs index 9d08aab..ca99eca 100644 --- a/CarpentryWorkshopView/FormComponents.Designer.cs +++ b/CarpentryWorkshopView/FormComponents.Designer.cs @@ -97,7 +97,7 @@ this.Controls.Add(this.ButtonAdd); this.Controls.Add(this.dataGridView); this.Name = "FormComponents"; - this.Text = "Экипировка"; + this.Text = "Компонент"; this.Load += new System.EventHandler(this.FormComponents_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/CarpentryWorkshopView/FormWoodComponent.Designer.cs b/CarpentryWorkshopView/FormWoodComponent.Designer.cs index ed2d6dd..3461628 100644 --- a/CarpentryWorkshopView/FormWoodComponent.Designer.cs +++ b/CarpentryWorkshopView/FormWoodComponent.Designer.cs @@ -43,7 +43,7 @@ this.labelComponent.Name = "labelComponent"; this.labelComponent.Size = new System.Drawing.Size(76, 15); this.labelComponent.TabIndex = 0; - this.labelComponent.Text = "Экипировка:"; + this.labelComponent.Text = "Компонент:"; // // labelCount // @@ -102,7 +102,7 @@ this.Controls.Add(this.labelCount); this.Controls.Add(this.labelComponent); this.Name = "FormWoodComponent"; - this.Text = "экипировка набора"; + this.Text = "компонент набора"; this.ResumeLayout(false); this.PerformLayout();