PIbd-23_Baryshev_D.A._Garage/ProjectGarage/FormGarage.cs

96 lines
2.7 KiB
C#
Raw Permalink Normal View History

2024-11-20 14:50:06 +04:00
using ProjectGarage.Forms;
using System.ComponentModel;
using Unity;
2024-11-02 19:41:16 +04:00
namespace ProjectGarage
{
public partial class FormGarage : Form
2024-11-02 19:41:16 +04:00
{
2024-11-20 14:50:06 +04:00
private readonly IUnityContainer _container;
public FormGarage(IUnityContainer container)
2024-11-02 19:41:16 +04:00
{
InitializeComponent();
2024-11-20 14:50:06 +04:00
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void DriversToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormDrivers>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void TrucksToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormTrucks>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void RoutesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormRoutes>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void FuelsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormFuels>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void TransportationToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormTransportations>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ReplenishmentToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormReplenishments>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
2024-11-02 19:41:16 +04:00
}
}
}