PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/FormAdvocateApp.cs
2024-11-09 03:06:08 +04:00

82 lines
2.3 KiB
C#

using ProjectGSM.Forms;
using System.ComponentModel;
using Unity;
namespace ProjectGSM
{
public partial class FormAdvocateApp : Form
{
private readonly IUnityContainer _container;
public FormAdvocateApp(IUnityContainer container)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
}
private void clientsMenuItem_Click_1(object sender, EventArgs e)
{
try
{
_container.Resolve<FormClients>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void advocatesMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormAdvocates>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void casesMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormCases>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void courtsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormCourts>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void statusHistoryRepositoryMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStatusesHistory>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}