ProjectLib/ProjectLibrary/FormLibrary.cs

76 lines
2.2 KiB
C#

using Unity;
namespace ProjectLibrary
{
public partial class FormLibrary : Form
{
private readonly IUnityContainer _container;
public FormLibrary(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void ÷èòàòåëèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<Forms.FReaders>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void çàêàçàòüÊíèãèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<Forms.FOrders>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void êíèãàToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<Forms.FBooks>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void áèáëèîòåêèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<Forms.FLibraries>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void îáíîâëåíèåÁèëåòàToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<Forms.FTiclet_Extensions>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}