Compare commits
No commits in common. "ca865bc1f0f15f4b0b2baa324c841df7d20a47ef" and "4498a36c12db02798c8215901f8d5f1e4d487102" have entirely different histories.
ca865bc1f0
...
4498a36c12
@ -1,4 +1,4 @@
|
||||
using Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -80,7 +80,7 @@ namespace Bus
|
||||
|
||||
private void ButtonAddBus_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listBoxMaps.SelectedIndex == -1)
|
||||
if (_mapBusCollectionGeneric == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -94,10 +94,11 @@ namespace Bus
|
||||
}
|
||||
|
||||
DrawingObjectBus bus = new(form.SelectedBus);
|
||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + bus != -1)
|
||||
|
||||
if (_mapBusCollectionGeneric + bus != -1)
|
||||
{
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||
pictureBox.Image = _mapBusCollectionGeneric.ShowSet();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -108,27 +109,20 @@ namespace Bus
|
||||
|
||||
private void ButtonRemoveBus_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listBoxMaps.SelectedIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (MessageBox.Show("Удалить объект?", "Удаление",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
|
||||
if (_mapBusCollectionGeneric - pos != null)
|
||||
{
|
||||
MessageBox.Show("Объект удален");
|
||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||
pictureBox.Image = _mapBusCollectionGeneric.ShowSet();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user