ISEbd-22_Rozhkov.I.E._Simple/GasStation/FormGasstation.cs

78 lines
2.3 KiB
C#
Raw Normal View History

2024-11-15 18:27:06 +04:00
using GasStation.Forms;
using Unity;
2024-11-13 23:20:06 +04:00
namespace GasStation
{
public partial class FormGasStation : System.Windows.Forms.Form
{
2024-11-15 18:27:06 +04:00
private readonly IUnityContainer _container;
public FormGasStation(IUnityContainer container)
2024-11-13 23:20:06 +04:00
{
InitializeComponent();
2024-11-15 18:27:06 +04:00
_container = container ??
throw new ArgumentNullException(nameof(container));
}
private void GasmanToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormGasmen>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void SupplierToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormSuppliers>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ProductToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormProducts>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void SupplyToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormSupplies>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void SellingToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormSellings>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
2024-11-13 23:20:06 +04:00
}
}
}