PIbd-21 Valiulov I.A. LabWork02 #3

Open
Ilyas wants to merge 5 commits from LabWork02 into LabWork01
2 changed files with 2 additions and 3 deletions
Showing only changes of commit 77edac6d4b - Show all commits

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