From 77edac6d4bda474bea48fb9c7d621995146fca28 Mon Sep 17 00:00:00 2001 From: IlyasValiulov Date: Fri, 15 Nov 2024 00:19:07 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B0=202=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CarpentryWorkshop/Forms/FormMaterialReplenishment.cs | 3 +-- .../CarpentryWorkshop/Forms/FormProductMaterial.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CarpentryWorkshop/CarpentryWorkshop/Forms/FormMaterialReplenishment.cs b/CarpentryWorkshop/CarpentryWorkshop/Forms/FormMaterialReplenishment.cs index 5037445..e4d8bbb 100644 --- a/CarpentryWorkshop/CarpentryWorkshop/Forms/FormMaterialReplenishment.cs +++ b/CarpentryWorkshop/CarpentryWorkshop/Forms/FormMaterialReplenishment.cs @@ -1,5 +1,4 @@ using CarpentryWorkshop.Entities; -using CarpentryWorkshop.Entities.Enums; using CarpentryWorkshop.Repositories; namespace CarpentryWorkshop.Forms @@ -34,7 +33,7 @@ namespace CarpentryWorkshop.Forms { InitializeComponent(); _materialSpentRepository = materialSpentRepository ?? throw new ArgumentNullException(nameof(materialSpentRepository)); - comboBoxMaterial.DataSource = materialRepository.ReadMaterials(); + comboBoxMaterial.DataSource = materialRepository.ReadMaterials() ?? throw new ArgumentNullException(nameof(materialRepository)); comboBoxMaterial.DisplayMember = "Name"; comboBoxMaterial.ValueMember = "Id"; } diff --git a/CarpentryWorkshop/CarpentryWorkshop/Forms/FormProductMaterial.cs b/CarpentryWorkshop/CarpentryWorkshop/Forms/FormProductMaterial.cs index 3c99b19..a5f8ec1 100644 --- a/CarpentryWorkshop/CarpentryWorkshop/Forms/FormProductMaterial.cs +++ b/CarpentryWorkshop/CarpentryWorkshop/Forms/FormProductMaterial.cs @@ -24,9 +24,9 @@ namespace CarpentryWorkshop.Forms comboBoxProduct.SelectedItem = product.Type; numericUpDownCount.Value = product.CountInWarehouse; _productId = value; + dataGridView.Rows.Clear(); var rows = new List(); - foreach (var productMaterial in product.ProductMaterial) { var material = _materialRepository.ReadMaterialById(productMaterial.MaterialId);