96 lines
2.7 KiB
C#
96 lines
2.7 KiB
C#
using ProjectGarage.Forms;
|
|
using System.ComponentModel;
|
|
using Unity;
|
|
|
|
namespace ProjectGarage
|
|
{
|
|
public partial class FormGarage : Form
|
|
{
|
|
private readonly IUnityContainer _container;
|
|
|
|
public FormGarage(IUnityContainer container)
|
|
{
|
|
InitializeComponent();
|
|
_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, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
private void TrucksToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
_container.Resolve<FormTrucks>().ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
private void RoutesToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
_container.Resolve<FormRoutes>().ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
private void FuelsToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
_container.Resolve<FormFuels>().ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
private void TransportationToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
_container.Resolve<FormTransportations>().ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
private void ReplenishmentToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
_container.Resolve<FormReplenishments>().ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
|
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
}
|
|
}
|