лаба 2 правки

This commit is contained in:
IlyasValiulov 2024-11-15 00:19:07 +04:00
parent 7ebcb8e97d
commit 77edac6d4b
2 changed files with 2 additions and 3 deletions

View File

@ -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";
}

View File

@ -24,9 +24,9 @@ namespace CarpentryWorkshop.Forms
comboBoxProduct.SelectedItem = product.Type;
numericUpDownCount.Value = product.CountInWarehouse;
_productId = value;
dataGridView.Rows.Clear();
var rows = new List<DataGridViewRow>();
foreach (var productMaterial in product.ProductMaterial)
{
var material = _materialRepository.ReadMaterialById(productMaterial.MaterialId);