PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/FormAdvocateApp.cs

82 lines
2.3 KiB
C#
Raw Permalink Normal View History

2024-11-05 03:59:13 +04:00
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, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void advocatesMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormAdvocates>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void casesMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormCases>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void courtsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormCourts>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void statusHistoryRepositoryMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStatusesHistory>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}