This commit is contained in:
Алексей Тихоненков 2025-01-13 19:06:42 +04:00
parent 91f4abfeb0
commit 2eb7bdacbe
9 changed files with 6 additions and 28 deletions

View File

@ -22,10 +22,9 @@ namespace Lab3Form
public class PluginsConvention : IPluginsConvention public class PluginsConvention : IPluginsConvention
{ {
private readonly IOrderLogic _orderLogic; private readonly IOrderLogic _orderLogic;
private readonly ICityLogic _selecteditemLogic; private readonly ICityLogic _cityLogic;
private readonly ControlDataTableTable _controlDataTableTable; private readonly ControlDataTableTable _controlDataTableTable;
private readonly ExcelTableComponent _excelComponent; private readonly ExcelTableComponent _excelComponent;
private readonly ComponentHistogramToPdf _componentHistogramToPdf;
public string PluginName { get; set; } = "Plugin"; public string PluginName { get; set; } = "Plugin";
@ -37,10 +36,9 @@ namespace Lab3Form
public PluginsConvention() public PluginsConvention()
{ {
_orderLogic = new OrderLogic(new OrderStorage()); _orderLogic = new OrderLogic(new OrderStorage());
_selecteditemLogic = new CityLogic(new CityStorage()); _cityLogic = new CityLogic(new CityStorage());
_controlDataTableTable = new(); _controlDataTableTable = new();
_excelComponent = new(); _excelComponent = new();
_componentHistogramToPdf = new();
} }
public PluginsConventionElement GetElement public PluginsConventionElement GetElement
@ -59,11 +57,11 @@ namespace Lab3Form
{ {
if (element == null) if (element == null)
{ {
return new FormOrder(_orderLogic, _selecteditemLogic); return new FormOrder(_orderLogic, _cityLogic);
} }
else else
{ {
FormOrder form = new FormOrder(_orderLogic, _selecteditemLogic); FormOrder form = new FormOrder(_orderLogic, _cityLogic);
form.Id = element.Id.GetHashCode(); form.Id = element.Id.GetHashCode();
return form; return form;
} }
@ -71,7 +69,7 @@ namespace Lab3Form
public Form GetThesaurus() public Form GetThesaurus()
{ {
return new FormCities(_selecteditemLogic); return new FormCities(_cityLogic);
} }
public bool DeleteElement(PluginsConventionElement element) public bool DeleteElement(PluginsConventionElement element)

Binary file not shown.

View File

@ -1,20 +0,0 @@
using PluginsConventionLibrary.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginsConventionLibrary
{
public class MainPluginConventionElement : PluginsConventionElement
{
public string ProductCategoryName { get; set; }
public string PhotoFilePath { get; set; }
public string FIO { get; set; }
public string Email { get; set; }
}
}

View File

@ -2,6 +2,6 @@
{ {
public class PluginsConventionSaveDocument public class PluginsConventionSaveDocument
{ {
public string FileName { get; set; } public required string FileName { get; set; }
} }
} }