done hard8
This commit is contained in:
parent
14d46c3035
commit
53b0086695
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,6 +18,7 @@
|
|||||||
*.dll
|
*.dll
|
||||||
|
|
||||||
/Pizzeria/ImplementationExtensions
|
/Pizzeria/ImplementationExtensions
|
||||||
|
/Pizzeria/BusinessLogicExtensions
|
||||||
|
|
||||||
# Mono auto generated files
|
# Mono auto generated files
|
||||||
mono_crash.*
|
mono_crash.*
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
using PizzeriaBusinessLogic.MailWorker;
|
||||||
|
using PizzeriaBusinessLogic.OfficePackage.Implements;
|
||||||
|
using PizzeriaBusinessLogic.OfficePackage;
|
||||||
|
using PizzeriaContracts.BusinessLogicsContracts;
|
||||||
|
using PizzeriaContracts.DI;
|
||||||
|
|
||||||
|
namespace PizzeriaBusinessLogic.BusinessLogics
|
||||||
|
{
|
||||||
|
public class BusinessLogicExtension : IBusinessLogicExtension
|
||||||
|
{
|
||||||
|
public int Priority => 0;
|
||||||
|
|
||||||
|
public void RegisterServices()
|
||||||
|
{
|
||||||
|
DependencyManager.Instance.RegisterType<IClientLogic, ClientLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IComponentLogic, ComponentLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IOrderLogic, OrderLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IPizzaLogic, PizzaLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IReportLogic, ReportLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IImplementerLogic, ImplementerLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IMessageInfoLogic, MessageInfoLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IBackUpLogic, BackUpLogic>();
|
||||||
|
DependencyManager.Instance.RegisterType<IShopLogic, ShopLogic>();
|
||||||
|
|
||||||
|
|
||||||
|
DependencyManager.Instance.RegisterType<AbstractSaveToWord, SaveToWord>();
|
||||||
|
DependencyManager.Instance.RegisterType<AbstractSaveToExcel, SaveToExcel>();
|
||||||
|
DependencyManager.Instance.RegisterType<AbstractSaveToPdf, SaveToPdf>();
|
||||||
|
DependencyManager.Instance.RegisterType<AbstractMailWorker, MailKitWorker>(true);
|
||||||
|
|
||||||
|
DependencyManager.Instance.RegisterType<IWorkProcess, WorkModeling>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,4 +18,8 @@
|
|||||||
<ProjectReference Include="..\PizzeriaDataModels\PizzeriaDataModels.csproj" />
|
<ProjectReference Include="..\PizzeriaDataModels\PizzeriaDataModels.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="copy /Y "$(TargetDir)*.dll" "$(SolutionDir)BusinessLogicExtensions\*.dll"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -13,13 +13,18 @@
|
|||||||
|
|
||||||
public bool IsUseAutoSize { get; private set; }
|
public bool IsUseAutoSize { get; private set; }
|
||||||
|
|
||||||
public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false)
|
public string Format { get; private set; }
|
||||||
|
|
||||||
|
public ColumnAttribute(string title = "", bool visible = true, int width = 0,
|
||||||
|
GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false,
|
||||||
|
string format = "")
|
||||||
{
|
{
|
||||||
Title = title;
|
Title = title;
|
||||||
Visible = visible;
|
Visible = visible;
|
||||||
Width = width;
|
Width = width;
|
||||||
GridViewAutoSize = gridViewAutoSize;
|
GridViewAutoSize = gridViewAutoSize;
|
||||||
IsUseAutoSize = isUseAutoSize;
|
IsUseAutoSize = isUseAutoSize;
|
||||||
|
Format = format;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,14 @@ namespace PizzeriaContracts.DI
|
|||||||
public static void InitDependency()
|
public static void InitDependency()
|
||||||
{
|
{
|
||||||
var ext = ServiceProviderLoader.GetImplementationExtensions();
|
var ext = ServiceProviderLoader.GetImplementationExtensions();
|
||||||
if (ext == null)
|
var extLogic = ServiceProviderLoader.GetBusinessLogicExtensions();
|
||||||
|
if (ext == null || extLogic == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям");
|
throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям");
|
||||||
}
|
}
|
||||||
// регистрируем зависимости
|
// регистрируем зависимости
|
||||||
ext.RegisterServices();
|
ext.RegisterServices();
|
||||||
|
extLogic.RegisterServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
9
Pizzeria/PizzeriaContracts/DI/IBusinessLogicExtension.cs
Normal file
9
Pizzeria/PizzeriaContracts/DI/IBusinessLogicExtension.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace PizzeriaContracts.DI
|
||||||
|
{
|
||||||
|
public interface IBusinessLogicExtension
|
||||||
|
{
|
||||||
|
public int Priority { get; }
|
||||||
|
|
||||||
|
public void RegisterServices();
|
||||||
|
}
|
||||||
|
}
|
@ -42,6 +42,35 @@ namespace PizzeriaContracts.DI
|
|||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IBusinessLogicExtension? GetBusinessLogicExtensions()
|
||||||
|
{
|
||||||
|
IBusinessLogicExtension? source = null;
|
||||||
|
var files = Directory.GetFiles(TryGetBusinessLogicExtensionsFolder(), "*.dll", SearchOption.AllDirectories);
|
||||||
|
foreach (var file in files.Distinct())
|
||||||
|
{
|
||||||
|
Assembly asm = Assembly.LoadFrom(file);
|
||||||
|
foreach (var t in asm.GetExportedTypes())
|
||||||
|
{
|
||||||
|
if (t.IsClass && typeof(IBusinessLogicExtension).IsAssignableFrom(t))
|
||||||
|
{
|
||||||
|
if (source == null)
|
||||||
|
{
|
||||||
|
source = (IBusinessLogicExtension)Activator.CreateInstance(t)!;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var newSource = (IBusinessLogicExtension)Activator.CreateInstance(t)!;
|
||||||
|
if (newSource.Priority > source.Priority)
|
||||||
|
{
|
||||||
|
source = newSource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
private static string TryGetImplementationExtensionsFolder()
|
private static string TryGetImplementationExtensionsFolder()
|
||||||
{
|
{
|
||||||
var directory = new DirectoryInfo(Directory.GetCurrentDirectory());
|
var directory = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||||
@ -51,5 +80,15 @@ namespace PizzeriaContracts.DI
|
|||||||
}
|
}
|
||||||
return $"{directory?.FullName}\\ImplementationExtensions";
|
return $"{directory?.FullName}\\ImplementationExtensions";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string TryGetBusinessLogicExtensionsFolder()
|
||||||
|
{
|
||||||
|
var directory = new DirectoryInfo(Directory.GetCurrentDirectory());
|
||||||
|
while (directory != null && !directory.GetDirectories("BusinessLogicExtensions", SearchOption.AllDirectories).Any(x => x.Name == "BusinessLogicExtensions"))
|
||||||
|
{
|
||||||
|
directory = directory.Parent;
|
||||||
|
}
|
||||||
|
return $"{directory?.FullName}\\BusinessLogicExtensions";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
50
Pizzeria/PizzeriaContracts/DI/UnityDependencyContainer.cs
Normal file
50
Pizzeria/PizzeriaContracts/DI/UnityDependencyContainer.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Unity;
|
||||||
|
using Unity.Microsoft.Logging;
|
||||||
|
|
||||||
|
namespace PizzeriaContracts.DI
|
||||||
|
{
|
||||||
|
public class UnityDependencyContainer : IDependencyContainer
|
||||||
|
{
|
||||||
|
private readonly UnityContainer _container;
|
||||||
|
|
||||||
|
public UnityDependencyContainer()
|
||||||
|
{
|
||||||
|
_container = new UnityContainer();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddLogging(Action<ILoggingBuilder> configure)
|
||||||
|
{
|
||||||
|
_container.AddExtension(new LoggingExtension(LoggerFactory.Create(configure)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterType<T, U>(bool isSingle) where U : class, T where T : class
|
||||||
|
{
|
||||||
|
if (isSingle)
|
||||||
|
{
|
||||||
|
_container.RegisterSingleton<T, U>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_container.RegisterType<T, U>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterType<T>(bool isSingle) where T : class
|
||||||
|
{
|
||||||
|
if (isSingle)
|
||||||
|
{
|
||||||
|
_container.RegisterSingleton<T>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_container.RegisterType<T>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Resolve<T>()
|
||||||
|
{
|
||||||
|
return _container.Resolve<T>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Unity.Microsoft.Logging" Version="5.11.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -26,7 +26,7 @@ namespace PizzeriaContracts.ViewModels
|
|||||||
[Column(title: "Текст", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
|
[Column(title: "Текст", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
|
||||||
public string Body { get; set; } = string.Empty;
|
public string Body { get; set; } = string.Empty;
|
||||||
|
|
||||||
[DisplayName("Прочитанно")]
|
[Column("Прочитанно", width: 120)]
|
||||||
public bool IsReaded { get; set; }
|
public bool IsReaded { get; set; }
|
||||||
|
|
||||||
public string? ReplyMessageId { get; set; }
|
public string? ReplyMessageId { get; set; }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using PizzeriaDataModels.Models;
|
using PizzeriaContracts.Attributes;
|
||||||
|
using PizzeriaDataModels.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -8,17 +9,25 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PizzeriaContracts.ViewModels
|
namespace PizzeriaContracts.ViewModels
|
||||||
{
|
{
|
||||||
|
|
||||||
public class ShopViewModel : IShopModel
|
public class ShopViewModel : IShopModel
|
||||||
{
|
{
|
||||||
|
[Column(visible: false)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[DisplayName("Название")]
|
|
||||||
|
[Column(title: "Магазин", width: 200)]
|
||||||
public string ShopName { get; set; } = string.Empty;
|
public string ShopName { get; set; } = string.Empty;
|
||||||
[DisplayName("Адрес")]
|
|
||||||
|
[Column(title: "Адрес", width: 100)]
|
||||||
public string Adress { get; set; } = string.Empty;
|
public string Adress { get; set; } = string.Empty;
|
||||||
[DisplayName("Дата открытия")]
|
|
||||||
|
[Column(title: "Дата открытия", width: 100, format: "d")]
|
||||||
public DateTime OpeningDate { get; set; }
|
public DateTime OpeningDate { get; set; }
|
||||||
|
|
||||||
|
[Column(visible: false)]
|
||||||
public Dictionary<int, (IPizzaModel, int)> ShopPizzas { get; set; } = new();
|
public Dictionary<int, (IPizzaModel, int)> ShopPizzas { get; set; } = new();
|
||||||
[DisplayName("Вместимость")]
|
|
||||||
|
[Column(title: "Вместимость", width: 100)]
|
||||||
public int PizzaMaxCount { get; set; }
|
public int PizzaMaxCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,6 +14,8 @@ namespace PizzeriaDatabaseImplement
|
|||||||
DependencyManager.Instance.RegisterType<IComponentStorage, ComponentStorage>();
|
DependencyManager.Instance.RegisterType<IComponentStorage, ComponentStorage>();
|
||||||
DependencyManager.Instance.RegisterType<IImplementerStorage, ImplementerStorage>();
|
DependencyManager.Instance.RegisterType<IImplementerStorage, ImplementerStorage>();
|
||||||
DependencyManager.Instance.RegisterType<IMessageInfoStorage, MessageInfoStorage>();
|
DependencyManager.Instance.RegisterType<IMessageInfoStorage, MessageInfoStorage>();
|
||||||
|
DependencyManager.Instance.RegisterType<IShopStorage, ShopStorage>();
|
||||||
|
|
||||||
DependencyManager.Instance.RegisterType<IOrderStorage, OrderStorage>();
|
DependencyManager.Instance.RegisterType<IOrderStorage, OrderStorage>();
|
||||||
DependencyManager.Instance.RegisterType<IPizzaStorage, PizzaStorage>();
|
DependencyManager.Instance.RegisterType<IPizzaStorage, PizzaStorage>();
|
||||||
DependencyManager.Instance.RegisterType<IBackUpInfo, BackUpInfo>();
|
DependencyManager.Instance.RegisterType<IBackUpInfo, BackUpInfo>();
|
||||||
|
@ -1,19 +1,32 @@
|
|||||||
using PizzeriaContracts.BindingModels;
|
using PizzeriaContracts.BindingModels;
|
||||||
using PizzeriaContracts.ViewModels;
|
using PizzeriaContracts.ViewModels;
|
||||||
using PizzeriaDataModels.Models;
|
using PizzeriaDataModels.Models;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace PizzeriaDatabaseImplement.Models
|
namespace PizzeriaDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
|
[DataContract]
|
||||||
public class Shop : IShopModel
|
public class Shop : IShopModel
|
||||||
{
|
{
|
||||||
|
[DataMember]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
[Required]
|
||||||
public string ShopName { get; set; } = string.Empty;
|
public string ShopName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
[Required]
|
||||||
public string Adress { get; set; } = string.Empty;
|
public string Adress { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
[Required]
|
||||||
public DateTime OpeningDate { get; set; }
|
public DateTime OpeningDate { get; set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
[Required]
|
||||||
public int PizzaMaxCount { get; set; }
|
public int PizzaMaxCount { get; set; }
|
||||||
|
|
||||||
private Dictionary<int, (IPizzaModel, int)>? _shopPizzas = null;
|
private Dictionary<int, (IPizzaModel, int)>? _shopPizzas = null;
|
||||||
|
@ -7,18 +7,28 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace PizzeriaFileImplement.Models
|
namespace PizzeriaFileImplement.Models
|
||||||
{
|
{
|
||||||
|
[DataContract]
|
||||||
public class Shop : IShopModel
|
public class Shop : IShopModel
|
||||||
{
|
{
|
||||||
|
[DataMember]
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
public string ShopName { get; private set; } = string.Empty;
|
public string ShopName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
public string Adress { get; private set; } = string.Empty;
|
public string Adress { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
public DateTime OpeningDate { get; private set; }
|
public DateTime OpeningDate { get; private set; }
|
||||||
public Dictionary<int, int> Pizzas { get; private set; } = new();
|
public Dictionary<int, int> Pizzas { get; private set; } = new();
|
||||||
private Dictionary<int, (IPizzaModel, int)>? _shopPizzas = null;
|
private Dictionary<int, (IPizzaModel, int)>? _shopPizzas = null;
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
public Dictionary<int, (IPizzaModel, int)> ShopPizzas
|
public Dictionary<int, (IPizzaModel, int)> ShopPizzas
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -32,6 +42,7 @@ namespace PizzeriaFileImplement.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
public int PizzaMaxCount { get; private set; }
|
public int PizzaMaxCount { get; private set; }
|
||||||
|
|
||||||
public static Shop? Create(ShopBindingModel? model)
|
public static Shop? Create(ShopBindingModel? model)
|
||||||
|
@ -28,22 +28,6 @@ namespace PizzeriaListImplement.Models
|
|||||||
|
|
||||||
public int Id => throw new NotImplementedException();
|
public int Id => throw new NotImplementedException();
|
||||||
|
|
||||||
public static MessageInfo? Create(MessageInfoBindingModel model)
|
|
||||||
{
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new()
|
|
||||||
{
|
|
||||||
Body = model.Body,
|
|
||||||
Subject = model.Subject,
|
|
||||||
ClientId = model.ClientId,
|
|
||||||
MessageId = model.MessageId,
|
|
||||||
SenderName = model.SenderName,
|
|
||||||
DateDelivery = model.DateDelivery,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public static MessageInfo? Create(MessageInfoBindingModel model)
|
public static MessageInfo? Create(MessageInfoBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
|
@ -39,6 +39,7 @@ namespace PizzeriaView
|
|||||||
{
|
{
|
||||||
column.Width = columnAttr.Width;
|
column.Width = columnAttr.Width;
|
||||||
}
|
}
|
||||||
|
column.DefaultCellStyle.Format = columnAttr.Format;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
35
Pizzeria/PizzeriaView/FormComponents.Designer.cs
generated
35
Pizzeria/PizzeriaView/FormComponents.Designer.cs
generated
@ -43,13 +43,12 @@
|
|||||||
this.dataGridView.AllowUserToAddRows = false;
|
this.dataGridView.AllowUserToAddRows = false;
|
||||||
this.dataGridView.AllowUserToDeleteRows = false;
|
this.dataGridView.AllowUserToDeleteRows = false;
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Location = new System.Drawing.Point(10, 9);
|
this.dataGridView.Location = new System.Drawing.Point(11, 12);
|
||||||
this.dataGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.dataGridView.Name = "dataGridView";
|
this.dataGridView.Name = "dataGridView";
|
||||||
this.dataGridView.ReadOnly = true;
|
this.dataGridView.ReadOnly = true;
|
||||||
this.dataGridView.RowHeadersWidth = 51;
|
this.dataGridView.RowHeadersWidth = 51;
|
||||||
this.dataGridView.RowTemplate.Height = 29;
|
this.dataGridView.RowTemplate.Height = 29;
|
||||||
this.dataGridView.Size = new System.Drawing.Size(516, 320);
|
this.dataGridView.Size = new System.Drawing.Size(590, 427);
|
||||||
this.dataGridView.TabIndex = 0;
|
this.dataGridView.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// ToolsPanel
|
// ToolsPanel
|
||||||
@ -58,18 +57,16 @@
|
|||||||
this.ToolsPanel.Controls.Add(this.buttonDelete);
|
this.ToolsPanel.Controls.Add(this.buttonDelete);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonEdit);
|
this.ToolsPanel.Controls.Add(this.buttonEdit);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
||||||
this.ToolsPanel.Location = new System.Drawing.Point(532, 9);
|
this.ToolsPanel.Location = new System.Drawing.Point(608, 12);
|
||||||
this.ToolsPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.ToolsPanel.Name = "ToolsPanel";
|
this.ToolsPanel.Name = "ToolsPanel";
|
||||||
this.ToolsPanel.Size = new System.Drawing.Size(158, 320);
|
this.ToolsPanel.Size = new System.Drawing.Size(181, 427);
|
||||||
this.ToolsPanel.TabIndex = 1;
|
this.ToolsPanel.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// buttonUpdate
|
// buttonUpdate
|
||||||
//
|
//
|
||||||
this.buttonUpdate.Location = new System.Drawing.Point(27, 154);
|
this.buttonUpdate.Location = new System.Drawing.Point(31, 205);
|
||||||
this.buttonUpdate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.buttonUpdate.Name = "buttonUpdate";
|
this.buttonUpdate.Name = "buttonUpdate";
|
||||||
this.buttonUpdate.Size = new System.Drawing.Size(110, 27);
|
this.buttonUpdate.Size = new System.Drawing.Size(126, 36);
|
||||||
this.buttonUpdate.TabIndex = 3;
|
this.buttonUpdate.TabIndex = 3;
|
||||||
this.buttonUpdate.Text = "Обновить";
|
this.buttonUpdate.Text = "Обновить";
|
||||||
this.buttonUpdate.UseVisualStyleBackColor = true;
|
this.buttonUpdate.UseVisualStyleBackColor = true;
|
||||||
@ -77,10 +74,9 @@
|
|||||||
//
|
//
|
||||||
// buttonDelete
|
// buttonDelete
|
||||||
//
|
//
|
||||||
this.buttonDelete.Location = new System.Drawing.Point(27, 106);
|
this.buttonDelete.Location = new System.Drawing.Point(31, 141);
|
||||||
this.buttonDelete.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.buttonDelete.Name = "buttonDelete";
|
this.buttonDelete.Name = "buttonDelete";
|
||||||
this.buttonDelete.Size = new System.Drawing.Size(110, 27);
|
this.buttonDelete.Size = new System.Drawing.Size(126, 36);
|
||||||
this.buttonDelete.TabIndex = 2;
|
this.buttonDelete.TabIndex = 2;
|
||||||
this.buttonDelete.Text = "Удалить";
|
this.buttonDelete.Text = "Удалить";
|
||||||
this.buttonDelete.UseVisualStyleBackColor = true;
|
this.buttonDelete.UseVisualStyleBackColor = true;
|
||||||
@ -88,10 +84,9 @@
|
|||||||
//
|
//
|
||||||
// buttonEdit
|
// buttonEdit
|
||||||
//
|
//
|
||||||
this.buttonEdit.Location = new System.Drawing.Point(27, 57);
|
this.buttonEdit.Location = new System.Drawing.Point(31, 76);
|
||||||
this.buttonEdit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.buttonEdit.Name = "buttonEdit";
|
this.buttonEdit.Name = "buttonEdit";
|
||||||
this.buttonEdit.Size = new System.Drawing.Size(110, 27);
|
this.buttonEdit.Size = new System.Drawing.Size(126, 36);
|
||||||
this.buttonEdit.TabIndex = 1;
|
this.buttonEdit.TabIndex = 1;
|
||||||
this.buttonEdit.Text = "Изменить";
|
this.buttonEdit.Text = "Изменить";
|
||||||
this.buttonEdit.UseVisualStyleBackColor = true;
|
this.buttonEdit.UseVisualStyleBackColor = true;
|
||||||
@ -99,10 +94,9 @@
|
|||||||
//
|
//
|
||||||
// buttonAdd
|
// buttonAdd
|
||||||
//
|
//
|
||||||
this.buttonAdd.Location = new System.Drawing.Point(27, 12);
|
this.buttonAdd.Location = new System.Drawing.Point(31, 16);
|
||||||
this.buttonAdd.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.buttonAdd.Name = "buttonAdd";
|
this.buttonAdd.Name = "buttonAdd";
|
||||||
this.buttonAdd.Size = new System.Drawing.Size(110, 27);
|
this.buttonAdd.Size = new System.Drawing.Size(126, 36);
|
||||||
this.buttonAdd.TabIndex = 0;
|
this.buttonAdd.TabIndex = 0;
|
||||||
this.buttonAdd.Text = "Добавить";
|
this.buttonAdd.Text = "Добавить";
|
||||||
this.buttonAdd.UseVisualStyleBackColor = true;
|
this.buttonAdd.UseVisualStyleBackColor = true;
|
||||||
@ -110,12 +104,11 @@
|
|||||||
//
|
//
|
||||||
// FormComponents
|
// FormComponents
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(700, 338);
|
this.ClientSize = new System.Drawing.Size(800, 451);
|
||||||
this.Controls.Add(this.ToolsPanel);
|
this.Controls.Add(this.ToolsPanel);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
|
||||||
this.Name = "FormComponents";
|
this.Name = "FormComponents";
|
||||||
this.Text = "Ингредиенты";
|
this.Text = "Ингредиенты";
|
||||||
this.Load += new System.EventHandler(this.FormComponents_Load);
|
this.Load += new System.EventHandler(this.FormComponents_Load);
|
||||||
|
@ -27,21 +27,13 @@ namespace PizzeriaView
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = _logic.ReadList(null);
|
dataGridView.FillAndConfigGrid(_logic.ReadList(null));
|
||||||
if (list != null)
|
_logger.LogInformation("Загрузка компонентов");
|
||||||
{
|
|
||||||
dataGridView.DataSource = list;
|
|
||||||
dataGridView.Columns["Id"].Visible = false;
|
|
||||||
dataGridView.Columns["ComponentName"].AutoSizeMode =
|
|
||||||
DataGridViewAutoSizeColumnMode.Fill;
|
|
||||||
}
|
|
||||||
_logger.LogInformation("Загрузка ингридиентов");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Ошибка загрузки ингридиентов");
|
_logger.LogError(ex, "Ошибка загрузки компонентов");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
MessageBoxIcon.Error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
this.ToolsPanel.Controls.Add(this.buttonDel);
|
this.ToolsPanel.Controls.Add(this.buttonDel);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonUpd);
|
this.ToolsPanel.Controls.Add(this.buttonUpd);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
||||||
this.ToolsPanel.Location = new System.Drawing.Point(608, 12);
|
this.ToolsPanel.Location = new System.Drawing.Point(992, 12);
|
||||||
this.ToolsPanel.Name = "ToolsPanel";
|
this.ToolsPanel.Name = "ToolsPanel";
|
||||||
this.ToolsPanel.Size = new System.Drawing.Size(180, 426);
|
this.ToolsPanel.Size = new System.Drawing.Size(180, 426);
|
||||||
this.ToolsPanel.TabIndex = 3;
|
this.ToolsPanel.TabIndex = 3;
|
||||||
@ -99,14 +99,14 @@
|
|||||||
this.dataGridView.ReadOnly = true;
|
this.dataGridView.ReadOnly = true;
|
||||||
this.dataGridView.RowHeadersWidth = 51;
|
this.dataGridView.RowHeadersWidth = 51;
|
||||||
this.dataGridView.RowTemplate.Height = 29;
|
this.dataGridView.RowTemplate.Height = 29;
|
||||||
this.dataGridView.Size = new System.Drawing.Size(590, 426);
|
this.dataGridView.Size = new System.Drawing.Size(957, 426);
|
||||||
this.dataGridView.TabIndex = 2;
|
this.dataGridView.TabIndex = 2;
|
||||||
//
|
//
|
||||||
// FormImplementers
|
// FormImplementers
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
this.ClientSize = new System.Drawing.Size(1206, 450);
|
||||||
this.Controls.Add(this.ToolsPanel);
|
this.Controls.Add(this.ToolsPanel);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.Name = "FormImplementers";
|
this.Name = "FormImplementers";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Pizzeria;
|
using Pizzeria;
|
||||||
using PizzeriaContracts.BindingModels;
|
using PizzeriaContracts.BindingModels;
|
||||||
using PizzeriaContracts.BusinessLogicsContracts;
|
using PizzeriaContracts.BusinessLogicsContracts;
|
||||||
|
using PizzeriaContracts.DI;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -48,13 +49,10 @@ namespace PizzeriaView
|
|||||||
|
|
||||||
private void buttonAdd_Click(object sender, EventArgs e)
|
private void buttonAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormImplementer));
|
var form = DependencyManager.Instance.Resolve<FormImplementer>();
|
||||||
if (service is FormImplementer form)
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
LoadData();
|
||||||
{
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,14 +60,11 @@ namespace PizzeriaView
|
|||||||
{
|
{
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormImplementer));
|
var form = DependencyManager.Instance.Resolve<FormImplementer>();
|
||||||
if (service is FormImplementer form)
|
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
LoadData();
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ using Pizzeria;
|
|||||||
using PizzeriaBusinessLogic.MailWorker;
|
using PizzeriaBusinessLogic.MailWorker;
|
||||||
using PizzeriaContracts.BindingModels;
|
using PizzeriaContracts.BindingModels;
|
||||||
using PizzeriaContracts.BusinessLogicsContracts;
|
using PizzeriaContracts.BusinessLogicsContracts;
|
||||||
|
using PizzeriaContracts.DI;
|
||||||
using PizzeriaContracts.SearchModels;
|
using PizzeriaContracts.SearchModels;
|
||||||
using PizzeriaContracts.ViewModels;
|
using PizzeriaContracts.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
@ -110,7 +111,7 @@ namespace PizzeriaView
|
|||||||
|
|
||||||
private void buttonReply_Click(object sender, EventArgs e)
|
private void buttonReply_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormLetter));
|
var service = DependencyManager.Instance.Resolve<FormLetter>();
|
||||||
if (service is FormLetter form)
|
if (service is FormLetter form)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(model.ReplyMessageId))
|
if (!string.IsNullOrEmpty(model.ReplyMessageId))
|
||||||
|
@ -4,6 +4,7 @@ using Pizzeria;
|
|||||||
using PizzeriaBusinessLogic.BusinessLogics;
|
using PizzeriaBusinessLogic.BusinessLogics;
|
||||||
using PizzeriaContracts.BindingModels;
|
using PizzeriaContracts.BindingModels;
|
||||||
using PizzeriaContracts.BusinessLogicsContracts;
|
using PizzeriaContracts.BusinessLogicsContracts;
|
||||||
|
using PizzeriaContracts.DI;
|
||||||
using PizzeriaContracts.SearchModels;
|
using PizzeriaContracts.SearchModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -55,7 +56,7 @@ namespace PizzeriaView
|
|||||||
if (dataGridView.SelectedRows.Count <= 0)
|
if (dataGridView.SelectedRows.Count <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormLetter));
|
var service = DependencyManager.Instance.Resolve<FormLetter>();
|
||||||
if (service is FormLetter form)
|
if (service is FormLetter form)
|
||||||
{
|
{
|
||||||
string? messageId = dataGridView.SelectedRows[0].Cells["MessageId"].Value.ToString();
|
string? messageId = dataGridView.SelectedRows[0].Cells["MessageId"].Value.ToString();
|
||||||
|
5
Pizzeria/PizzeriaView/FormMain.Designer.cs
generated
5
Pizzeria/PizzeriaView/FormMain.Designer.cs
generated
@ -69,10 +69,11 @@
|
|||||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.bookToolStripMenuItem,
|
this.bookToolStripMenuItem,
|
||||||
this.отчётыToolStripMenuItem,
|
|
||||||
this.запускРаботToolStripMenuItem,
|
this.запускРаботToolStripMenuItem,
|
||||||
|
this.создатьБекапToolStripMenuItem,
|
||||||
this.почтаToolStripMenuItem,
|
this.почтаToolStripMenuItem,
|
||||||
this.создатьБекапToolStripMenuItem});
|
this.operationToolStripMenuItem,
|
||||||
|
this.отчётыToolStripMenuItem});
|
||||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.menuStrip1.Name = "menuStrip1";
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2);
|
this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2);
|
||||||
|
@ -150,29 +150,20 @@ namespace PizzeriaView
|
|||||||
|
|
||||||
private void shopsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void shopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormShops));
|
var form = DependencyManager.Instance.Resolve<FormShops>();
|
||||||
if (service is FormShops form)
|
form.ShowDialog();
|
||||||
{
|
|
||||||
form.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transactionToolStripMenuItem_Click(object sender, EventArgs e)
|
private void transactionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormCreateSupply));
|
var form = DependencyManager.Instance.Resolve<FormCreateSupply>();
|
||||||
if (service is FormCreateSupply form)
|
form.ShowDialog();
|
||||||
{
|
|
||||||
form.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SellToolStripMenuItem_Click(object sender, EventArgs e)
|
private void SellToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormSellPizza));
|
var form = DependencyManager.Instance.Resolve<FormSellPizza>();
|
||||||
if (service is FormSellPizza form)
|
form.ShowDialog();
|
||||||
{
|
|
||||||
form.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
@ -244,8 +235,7 @@ namespace PizzeriaView
|
|||||||
MessageBox.Show(ex.Message, "Ошибка создания бэкапа", MessageBoxButtons.OK,
|
MessageBox.Show(ex.Message, "Ошибка создания бэкапа", MessageBoxButtons.OK,
|
||||||
MessageBoxIcon.Error);
|
MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormMail));
|
var service = Program.ServiceProvider?.GetService(typeof(FormMail));
|
||||||
if (service is FormMail form)
|
if (service is FormMail form)
|
||||||
{
|
{
|
||||||
@ -265,20 +255,14 @@ namespace PizzeriaView
|
|||||||
|
|
||||||
private void BusyShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void BusyShopsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportShop));
|
var form = DependencyManager.Instance.Resolve<FormReportShop>();
|
||||||
if (service is FormReportShop form)
|
form.ShowDialog();
|
||||||
{
|
|
||||||
form.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders));
|
var form = DependencyManager.Instance.Resolve<FormReportGroupedOrders>();
|
||||||
if (service is FormReportGroupedOrders form)
|
form.ShowDialog();
|
||||||
{
|
|
||||||
form.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
Pizzeria/PizzeriaView/FormShops.Designer.cs
generated
26
Pizzeria/PizzeriaView/FormShops.Designer.cs
generated
@ -44,16 +44,16 @@
|
|||||||
this.ToolsPanel.Controls.Add(this.buttonDel);
|
this.ToolsPanel.Controls.Add(this.buttonDel);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonUpd);
|
this.ToolsPanel.Controls.Add(this.buttonUpd);
|
||||||
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
this.ToolsPanel.Controls.Add(this.buttonAdd);
|
||||||
this.ToolsPanel.Location = new System.Drawing.Point(608, 12);
|
this.ToolsPanel.Location = new System.Drawing.Point(676, 12);
|
||||||
this.ToolsPanel.Name = "ToolsPanel";
|
this.ToolsPanel.Name = "ToolsPanel";
|
||||||
this.ToolsPanel.Size = new System.Drawing.Size(180, 426);
|
this.ToolsPanel.Size = new System.Drawing.Size(180, 406);
|
||||||
this.ToolsPanel.TabIndex = 3;
|
this.ToolsPanel.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// buttonRef
|
// buttonRef
|
||||||
//
|
//
|
||||||
this.buttonRef.Location = new System.Drawing.Point(31, 206);
|
this.buttonRef.Location = new System.Drawing.Point(31, 196);
|
||||||
this.buttonRef.Name = "buttonRef";
|
this.buttonRef.Name = "buttonRef";
|
||||||
this.buttonRef.Size = new System.Drawing.Size(126, 36);
|
this.buttonRef.Size = new System.Drawing.Size(126, 34);
|
||||||
this.buttonRef.TabIndex = 3;
|
this.buttonRef.TabIndex = 3;
|
||||||
this.buttonRef.Text = "Обновить";
|
this.buttonRef.Text = "Обновить";
|
||||||
this.buttonRef.UseVisualStyleBackColor = true;
|
this.buttonRef.UseVisualStyleBackColor = true;
|
||||||
@ -61,9 +61,9 @@
|
|||||||
//
|
//
|
||||||
// buttonDel
|
// buttonDel
|
||||||
//
|
//
|
||||||
this.buttonDel.Location = new System.Drawing.Point(31, 142);
|
this.buttonDel.Location = new System.Drawing.Point(31, 135);
|
||||||
this.buttonDel.Name = "buttonDel";
|
this.buttonDel.Name = "buttonDel";
|
||||||
this.buttonDel.Size = new System.Drawing.Size(126, 36);
|
this.buttonDel.Size = new System.Drawing.Size(126, 34);
|
||||||
this.buttonDel.TabIndex = 2;
|
this.buttonDel.TabIndex = 2;
|
||||||
this.buttonDel.Text = "Удалить";
|
this.buttonDel.Text = "Удалить";
|
||||||
this.buttonDel.UseVisualStyleBackColor = true;
|
this.buttonDel.UseVisualStyleBackColor = true;
|
||||||
@ -71,9 +71,9 @@
|
|||||||
//
|
//
|
||||||
// buttonUpd
|
// buttonUpd
|
||||||
//
|
//
|
||||||
this.buttonUpd.Location = new System.Drawing.Point(31, 76);
|
this.buttonUpd.Location = new System.Drawing.Point(31, 72);
|
||||||
this.buttonUpd.Name = "buttonUpd";
|
this.buttonUpd.Name = "buttonUpd";
|
||||||
this.buttonUpd.Size = new System.Drawing.Size(126, 36);
|
this.buttonUpd.Size = new System.Drawing.Size(126, 34);
|
||||||
this.buttonUpd.TabIndex = 1;
|
this.buttonUpd.TabIndex = 1;
|
||||||
this.buttonUpd.Text = "Изменить";
|
this.buttonUpd.Text = "Изменить";
|
||||||
this.buttonUpd.UseVisualStyleBackColor = true;
|
this.buttonUpd.UseVisualStyleBackColor = true;
|
||||||
@ -81,9 +81,9 @@
|
|||||||
//
|
//
|
||||||
// buttonAdd
|
// buttonAdd
|
||||||
//
|
//
|
||||||
this.buttonAdd.Location = new System.Drawing.Point(31, 16);
|
this.buttonAdd.Location = new System.Drawing.Point(31, 15);
|
||||||
this.buttonAdd.Name = "buttonAdd";
|
this.buttonAdd.Name = "buttonAdd";
|
||||||
this.buttonAdd.Size = new System.Drawing.Size(126, 36);
|
this.buttonAdd.Size = new System.Drawing.Size(126, 34);
|
||||||
this.buttonAdd.TabIndex = 0;
|
this.buttonAdd.TabIndex = 0;
|
||||||
this.buttonAdd.Text = "Добавить";
|
this.buttonAdd.Text = "Добавить";
|
||||||
this.buttonAdd.UseVisualStyleBackColor = true;
|
this.buttonAdd.UseVisualStyleBackColor = true;
|
||||||
@ -94,19 +94,19 @@
|
|||||||
this.dataGridView.AllowUserToAddRows = false;
|
this.dataGridView.AllowUserToAddRows = false;
|
||||||
this.dataGridView.AllowUserToDeleteRows = false;
|
this.dataGridView.AllowUserToDeleteRows = false;
|
||||||
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView.Location = new System.Drawing.Point(12, 12);
|
this.dataGridView.Location = new System.Drawing.Point(12, 11);
|
||||||
this.dataGridView.Name = "dataGridView";
|
this.dataGridView.Name = "dataGridView";
|
||||||
this.dataGridView.ReadOnly = true;
|
this.dataGridView.ReadOnly = true;
|
||||||
this.dataGridView.RowHeadersWidth = 51;
|
this.dataGridView.RowHeadersWidth = 51;
|
||||||
this.dataGridView.RowTemplate.Height = 29;
|
this.dataGridView.RowTemplate.Height = 29;
|
||||||
this.dataGridView.Size = new System.Drawing.Size(590, 426);
|
this.dataGridView.Size = new System.Drawing.Size(649, 415);
|
||||||
this.dataGridView.TabIndex = 2;
|
this.dataGridView.TabIndex = 2;
|
||||||
//
|
//
|
||||||
// FormShops
|
// FormShops
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
this.ClientSize = new System.Drawing.Size(868, 429);
|
||||||
this.Controls.Add(this.ToolsPanel);
|
this.Controls.Add(this.ToolsPanel);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.Name = "FormShops";
|
this.Name = "FormShops";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Pizzeria;
|
using Pizzeria;
|
||||||
using PizzeriaContracts.BindingModels;
|
using PizzeriaContracts.BindingModels;
|
||||||
using PizzeriaContracts.BusinessLogicsContracts;
|
using PizzeriaContracts.BusinessLogicsContracts;
|
||||||
|
using PizzeriaContracts.DI;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -35,15 +36,7 @@ namespace PizzeriaView
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = _logic.ReadList(null);
|
dataGridView.FillAndConfigGrid(_logic.ReadList(null));
|
||||||
if (list != null)
|
|
||||||
{
|
|
||||||
dataGridView.DataSource = list;
|
|
||||||
dataGridView.Columns["Id"].Visible = false;
|
|
||||||
dataGridView.Columns["ShopPizzas"].Visible = false;
|
|
||||||
dataGridView.Columns["ShopName"].AutoSizeMode =
|
|
||||||
DataGridViewAutoSizeColumnMode.Fill;
|
|
||||||
}
|
|
||||||
_logger.LogInformation("Загрузка магазинов");
|
_logger.LogInformation("Загрузка магазинов");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -55,7 +48,7 @@ namespace PizzeriaView
|
|||||||
|
|
||||||
private void ButtonAdd_Click(object sender, EventArgs e)
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormShop));
|
var service = DependencyManager.Instance.Resolve<FormShop>();
|
||||||
if (service is FormShop form)
|
if (service is FormShop form)
|
||||||
{
|
{
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
@ -69,7 +62,7 @@ namespace PizzeriaView
|
|||||||
{
|
{
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormShop));
|
var service = DependencyManager.Instance.Resolve<FormShop>();
|
||||||
if (service is FormShop form)
|
if (service is FormShop form)
|
||||||
{
|
{
|
||||||
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
@ -11,7 +11,6 @@ using PizzeriaView;
|
|||||||
using PizzeriaBusinessLogic.OfficePackage;
|
using PizzeriaBusinessLogic.OfficePackage;
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
using Microsoft.EntityFrameworkCore.Design;
|
||||||
using PizzeriaContracts.DI;
|
using PizzeriaContracts.DI;
|
||||||
using PizzeriaBusinessLogic.OfficePackage.Implements;
|
|
||||||
|
|
||||||
namespace Pizzeria
|
namespace Pizzeria
|
||||||
{
|
{
|
||||||
@ -62,34 +61,6 @@ namespace Pizzeria
|
|||||||
option.AddNLog("nlog.config");
|
option.AddNLog("nlog.config");
|
||||||
});
|
});
|
||||||
|
|
||||||
DependencyManager.Instance.RegisterType<IClientLogic, ClientLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IComponentLogic, ComponentLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IOrderLogic, OrderLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IPizzaLogic, PizzaLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IReportLogic, ReportLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IImplementerLogic, ImplementerLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IMessageInfoLogic, MessageInfoLogic>();
|
|
||||||
DependencyManager.Instance.RegisterType<IBackUpLogic, BackUpLogic>();
|
|
||||||
|
|
||||||
DependencyManager.Instance.RegisterType<AbstractSaveToWord, SaveToWord>();
|
|
||||||
DependencyManager.Instance.RegisterType<AbstractSaveToExcel, SaveToExcel>();
|
|
||||||
DependencyManager.Instance.RegisterType<AbstractSaveToPdf, SaveToPdf>();
|
|
||||||
DependencyManager.Instance.RegisterType<AbstractMailWorker, MailKitWorker>(true);
|
|
||||||
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
||||||
services.AddTransient<IClientLogic, ClientLogic>();
|
|
||||||
services.AddTransient<IShopStorage, ShopStorage>();
|
|
||||||
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
||||||
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
||||||
services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
|
||||||
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
||||||
services.AddTransient<IPizzaLogic, PizzaLogic>();
|
|
||||||
services.AddTransient<IReportLogic, ReportLogic>();
|
|
||||||
services.AddTransient<IMessageInfoLogic, MessageInfoLogic>();
|
|
||||||
services.AddTransient<IWorkProcess, WorkModeling>();
|
|
||||||
services.AddTransient<IShopLogic, ShopLogic>();
|
|
||||||
|
|
||||||
DependencyManager.Instance.RegisterType<IWorkProcess, WorkModeling>();
|
|
||||||
|
|
||||||
DependencyManager.Instance.RegisterType<FormMain>();
|
DependencyManager.Instance.RegisterType<FormMain>();
|
||||||
DependencyManager.Instance.RegisterType<FormComponent>();
|
DependencyManager.Instance.RegisterType<FormComponent>();
|
||||||
DependencyManager.Instance.RegisterType<FormComponents>();
|
DependencyManager.Instance.RegisterType<FormComponents>();
|
||||||
@ -103,27 +74,14 @@ namespace Pizzeria
|
|||||||
DependencyManager.Instance.RegisterType<FormImplementers>();
|
DependencyManager.Instance.RegisterType<FormImplementers>();
|
||||||
DependencyManager.Instance.RegisterType<FormImplementer>();
|
DependencyManager.Instance.RegisterType<FormImplementer>();
|
||||||
DependencyManager.Instance.RegisterType<FormMail>();
|
DependencyManager.Instance.RegisterType<FormMail>();
|
||||||
services.AddTransient<FormComponent>();
|
|
||||||
services.AddTransient<FormComponents>();
|
DependencyManager.Instance.RegisterType<FormShop>();
|
||||||
services.AddTransient<FormCreateOrder>();
|
DependencyManager.Instance.RegisterType<FormShops>();
|
||||||
services.AddTransient<FormPizza>();
|
DependencyManager.Instance.RegisterType<FormSellPizza>();
|
||||||
services.AddTransient<FormPizzaComponent>();
|
DependencyManager.Instance.RegisterType<FormReportShop>();
|
||||||
services.AddTransient<FormPizzas>();
|
DependencyManager.Instance.RegisterType<FormReportGroupedOrders>();
|
||||||
services.AddTransient<FormShop>();
|
DependencyManager.Instance.RegisterType<FormLetter>();
|
||||||
services.AddTransient<FormShops>();
|
DependencyManager.Instance.RegisterType<FormCreateSupply>();
|
||||||
services.AddTransient<FormCreateSupply>();
|
|
||||||
services.AddTransient<FormSellPizza>();
|
|
||||||
services.AddTransient<FormMain>();
|
|
||||||
services.AddTransient<FormReportPizzaComponents>();
|
|
||||||
services.AddTransient<FormReportOrders>();
|
|
||||||
services.AddTransient<FormClients>();
|
|
||||||
services.AddTransient<EntityFrameworkDesignServicesBuilder>();
|
|
||||||
services.AddTransient<FormReportShop>();
|
|
||||||
services.AddTransient<FormReportGroupedOrders>();
|
|
||||||
services.AddTransient<FormImplementers>();
|
|
||||||
services.AddTransient<FormImplementer>();
|
|
||||||
services.AddTransient<FormMail>();
|
|
||||||
services.AddTransient<FormLetter>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void MailCheck(object obj) => DependencyManager.Instance.Resolve<AbstractMailWorker>()?.MailCheck();
|
private static void MailCheck(object obj) => DependencyManager.Instance.Resolve<AbstractMailWorker>()?.MailCheck();
|
||||||
|
Loading…
Reference in New Issue
Block a user