46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.ComponentModel;
|
|
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)
|
|
{
|
|
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|