2024-11-26 20:29:11 +03:00

97 lines
2.9 KiB
C#

using ProductionInCehOTP.Entities;
using ProductionInCehOTP.Forms;
using ProductionInCehOTP.Forms.ArrivalsMaterials_Forms;
using ProductionInCehOTP.Forms.Material_Forms;
using ProductionInCehOTP.Forms.PlanWork_Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using Unity;
namespace ProductionInCehOTP
{
public partial class ProductionInIndustrial : Form
{
private readonly IUnityContainer _container;
public ProductionInIndustrial(IUnityContainer container)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
}
private void WorkerToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormWorkers>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ArrivalToCaseToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormArrivalsOfMaterials>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ProductToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormProducts>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ArrivalMaterialsToProductToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormMaterials>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void PlanWorkToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormPlansWork>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}