From d6a4ef895eaee9310f6211028d8a20f9b1e2b06a Mon Sep 17 00:00:00 2001 From: kaznacheeva Date: Mon, 22 Apr 2024 23:05:38 +0400 Subject: [PATCH] poka shlyapa --- SoftwareInstallation/SoftwareInstallationView/FormShop.cs | 7 ++++--- SoftwareInstallation/SoftwareInstallationView/FormShops.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SoftwareInstallation/SoftwareInstallationView/FormShop.cs b/SoftwareInstallation/SoftwareInstallationView/FormShop.cs index 31d24da..39ac5d7 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormShop.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormShop.cs @@ -20,6 +20,7 @@ namespace SoftwareInstallationView { public partial class FormShop : Form { + private readonly List? _listShops; /// /// Логгер /// @@ -46,8 +47,8 @@ namespace SoftwareInstallationView { InitializeComponent(); _logger = logger; + _listShops = new (); _logic = logic; - _shopPackages = new Dictionary(); } /// /// Загрузка списка изделий в магазине @@ -67,7 +68,7 @@ namespace SoftwareInstallationView textBoxShop.Text = view.Name; textBoxAddress.Text = view.Address; openingDatePicker.Text = view.DateOpening.ToString(); - _shopPackages = view.Packages ?? new Dictionary(); + _shopPackages = view.ShopPackages ?? new Dictionary(); LoadData(); } } @@ -104,7 +105,7 @@ namespace SoftwareInstallationView Name = textBoxShop.Text, Address = textBoxAddress.Text, DateOpening = openingDatePicker.Value.Date, - Packages = _shopPackages + PackageMaxCount = (int)numericUpDown.Value }; var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model); if (!operationResult) diff --git a/SoftwareInstallation/SoftwareInstallationView/FormShops.cs b/SoftwareInstallation/SoftwareInstallationView/FormShops.cs index 31b88b1..cdcf2f5 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormShops.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormShops.cs @@ -41,7 +41,7 @@ namespace SoftwareInstallationView dataGridView.DataSource = list; dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["Packages"].Visible = false; + dataGridView.Columns["ShopPackages"].Visible = false; dataGridView.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }