Presnyakova V.V Lab_8 #9
@ -47,7 +47,7 @@ namespace JewelryStore
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormComponent));
|
||||
var service = DependencyManager.Instance.Resolve<FormComponent));
|
||||
if (service is FormComponent form)
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
@ -99,7 +99,7 @@ namespace JewelryStore
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service =
|
||||
Program.ServiceProvider?.GetService(typeof(FormComponent));
|
||||
DependencyManager.Instance.Resolve<FormComponent));
|
||||
if (service is FormComponent form)
|
||||
{
|
||||
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
|
@ -26,7 +26,7 @@ namespace JewelryStore
|
||||
|
||||
private void AddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormImplementer));
|
||||
var service = DependencyManager.Instance.Resolve<FormImplementer));
|
||||
|
||||
if (service is FormImplementer form)
|
||||
{
|
||||
@ -41,7 +41,7 @@ namespace JewelryStore
|
||||
{
|
||||
if (DataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormImplementer));
|
||||
var service = DependencyManager.Instance.Resolve<FormImplementer));
|
||||
if (service is FormImplementer form)
|
||||
{
|
||||
form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
|
@ -84,7 +84,7 @@ namespace JewelryStore
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormJewelComponent));
|
||||
var service = DependencyManager.Instance.Resolve<FormJewelComponent));
|
||||
if (service is FormJewelComponent form)
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
@ -112,7 +112,7 @@ namespace JewelryStore
|
||||
{
|
||||
if (dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormJewelComponent));
|
||||
var service = DependencyManager.Instance.Resolve<FormJewelComponent));
|
||||
if (service is FormJewelComponent form)
|
||||
{
|
||||
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);
|
||||
|
@ -42,7 +42,7 @@ namespace JewelryStore
|
||||
|
||||
private void AddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormJewel));
|
||||
var service = DependencyManager.Instance.Resolve<FormJewel));
|
||||
|
||||
if (service is FormJewel form)
|
||||
{
|
||||
@ -56,7 +56,7 @@ namespace JewelryStore
|
||||
{
|
||||
if (DataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormJewel));
|
||||
var service = DependencyManager.Instance.Resolve<FormJewel));
|
||||
|
||||
if (service is FormJewel form)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
using JewelryStoreBusinessLogic.BusinessLogics;
|
||||
using JewelryStoreContracts.BindingModels;
|
||||
using JewelryStoreContracts.BusinessLogicsContracts;
|
||||
using JewelryStoreContracts.DI;
|
||||
using JewelryStoreDataModels.Enums;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
@ -44,7 +45,7 @@ namespace JewelryStore
|
||||
{
|
||||
try
|
||||
{
|
||||
DataGridView.FillAndConfigGrid(_orderLogic.ReadList(null));
|
||||
dataGridView.FillAndConfigGrid(_orderLogic.ReadList(null));
|
||||
_logger.LogInformation("Загрузка заказов");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -57,16 +58,14 @@ namespace JewelryStore
|
||||
|
||||
private void компонентыToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormComponents));
|
||||
if (service is FormComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
var form = DependencyManager.Instance.Resolve<FormComponents>;
|
||||
form.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
private void драгоценностиToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormJewels));
|
||||
var service = DependencyManager.Instance.Resolve<FormJewels));
|
||||
|
||||
if (service is FormJewels form)
|
||||
{
|
||||
@ -76,7 +75,7 @@ namespace JewelryStore
|
||||
|
||||
private void buttonCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder));
|
||||
var service = DependencyManager.Instance.Resolve<FormCreateOrder));
|
||||
if (service is FormCreateOrder form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
@ -214,7 +213,7 @@ namespace JewelryStore
|
||||
EventArgs e)
|
||||
{
|
||||
var service =
|
||||
Program.ServiceProvider?.GetService(typeof(FormReportJewelComponents));
|
||||
DependencyManager.Instance.Resolve<FormReportJewelComponents));
|
||||
if (service is FormReportJewelComponents form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
@ -222,7 +221,7 @@ namespace JewelryStore
|
||||
}
|
||||
private void списокЗаказзовToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
|
||||
var service = DependencyManager.Instance.Resolve<FormReportOrders));
|
||||
if (service is FormReportOrders form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
@ -231,7 +230,7 @@ namespace JewelryStore
|
||||
|
||||
private void клиентыToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormClients));
|
||||
var service = DependencyManager.Instance.Resolve<FormClients));
|
||||
if (service is FormClients form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
@ -242,7 +241,7 @@ namespace JewelryStore
|
||||
{
|
||||
{
|
||||
|
||||
_workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic);
|
||||
_workProcess.DoWork(( DependencyManager.Instance.Resolve<IImplementerLogic)) as IImplementerLogic)!, _orderLogic);
|
||||
MessageBox.Show("Процесс обработки запущен", "Сообщение",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
@ -250,7 +249,7 @@ namespace JewelryStore
|
||||
|
||||
private void исполнителиToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormImplementers));
|
||||
var service = DependencyManager.Instance.Resolve<FormImplementers));
|
||||
|
||||
if (service is FormImplementers form)
|
||||
{
|
||||
@ -259,7 +258,7 @@ namespace JewelryStore
|
||||
}
|
||||
private void элПисьмаToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormMails));
|
||||
var service = DependencyManager.Instance.Resolve<FormMails));
|
||||
if (service is FormMails form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
|
Loading…
Reference in New Issue
Block a user