WIP ISEbd-12_Isaeva_V.D_Simple_LabWork05 #8

Merged
Victoria_Isaeva merged 1 commits from LabWork04 into LabWork05 2024-05-03 13:11:16 +04:00
2 changed files with 28 additions and 2 deletions

View File

@ -146,6 +146,7 @@
buttonDelBus.TabIndex = 4;
buttonDelBus.Text = "Удалить самолет";
buttonDelBus.UseVisualStyleBackColor = true;
buttonDelBus.Click += buttonDelBus_Click;
//
// buttonAddAirBus
//

View File

@ -249,7 +249,7 @@ namespace ProjectAirbus
return;
}
ICollectionGenericObjects<DrawningBus>? collection =_storageCollection[listBoxCollection.SelectedItem.ToString() ?? string.Empty];
ICollectionGenericObjects<DrawningBus>? collection = _storageCollection[listBoxCollection.SelectedItem.ToString() ?? string.Empty];
if (collection == null)
{
MessageBox.Show("Коллекция не проинициализирована");
@ -259,12 +259,37 @@ namespace ProjectAirbus
switch (comboBoxSelectorCompany.Text)
{
case "Хранилище":
_company = new AerodromService(pictureBox1.Width, pictureBox1.Height,collection);
_company = new AerodromService(pictureBox1.Width, pictureBox1.Height, collection);
break;
}
panelCompanyTools.Enabled = true;
RerfreshListBoxItems();
}
private void buttonDelBus_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBox.Text) || _company == null)
{
return;
}
if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
{
return;
}
int pos = Convert.ToInt32(maskedTextBox.Text);
if (_company - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox1.Image = _company.Show();
}
else
{
MessageBox.Show("Не удалось удалить объект");
}
}
}
}