diff --git a/Laba3/ManufacturerForm.Designer.cs b/Laba3/ManufacturerForm.Designer.cs index 8d7540d..d4b7d6d 100644 --- a/Laba3/ManufacturerForm.Designer.cs +++ b/Laba3/ManufacturerForm.Designer.cs @@ -28,12 +28,36 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "ManufacturerForm"; + dataGridView = new DataGridView(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Location = new Point(12, 12); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.Size = new Size(776, 426); + dataGridView.TabIndex = 0; + dataGridView.CellValueChanged += dataGridView_CellValueChanged; + dataGridView.UserAddedRow += dataGridView_UserAddedRow; + dataGridView.UserDeletingRow += dataGridView_UserDeletingRow; + // + // ManufacturerForm + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridView); + Name = "ManufacturerForm"; + Text = "ManufacturerForm"; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); } #endregion + + private DataGridView dataGridView; } } \ No newline at end of file diff --git a/Laba3/ManufacturerForm.resx b/Laba3/ManufacturerForm.resx index 1af7de1..af32865 100644 --- a/Laba3/ManufacturerForm.resx +++ b/Laba3/ManufacturerForm.resx @@ -1,17 +1,17 @@ п»ї - diff --git a/Laba3/ProductForm.cs b/Laba3/ProductForm.cs index 1002af6..7a2a07a 100644 --- a/Laba3/ProductForm.cs +++ b/Laba3/ProductForm.cs @@ -31,6 +31,7 @@ namespace Laba3 _isNewProduct = product == null; txtName.MinLength = MINL; txtName.MaxLength = MAXL; + //TODO dtpDeliveryDate.DateF if (!_isNewProduct) { diff --git a/Laba3/Program.cs b/Laba3/Program.cs index f19d060..8d5d27d 100644 --- a/Laba3/Program.cs +++ b/Laba3/Program.cs @@ -1,3 +1,6 @@ +using Data.Repositories; +using Data; + namespace Laba3 { internal static class Program @@ -10,8 +13,13 @@ namespace Laba3 { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - Application.Run(new MainForm()); + // Создание экземпляров репозиториев + var dbContext = new ApplicationDbContext(); + var productRepository = new ProductRepository(dbContext); + var manufacturerRepository = new ManufacturerRepository(dbContext); + + // Передача репозиториев в конструктор MainForm + Application.Run(new MainForm(productRepository, manufacturerRepository)); } } } \ No newline at end of file