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);