2023-02-20 01:35:50 +04:00
|
|
|
using ConfectioneryDatabaseImplement.Implements;
|
|
|
|
using ConfectioneryDatabaseImplement;
|
2023-02-03 23:25:31 +04:00
|
|
|
using ConfectioneryBusinessLogic.BusinessLogics;
|
|
|
|
using ConfectioneryContracts.BusinessLogicsContracts;
|
|
|
|
using ConfectioneryContracts.StoragesContract;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NLog.Extensions.Logging;
|
2023-02-15 04:14:07 +04:00
|
|
|
using ConfectioneryBusinessLogic;
|
2023-03-01 16:42:58 +04:00
|
|
|
using ConfectioneryBusinessLogic.OfficePackage.Implements;
|
|
|
|
using ConfectioneryBusinessLogic.OfficePackage;
|
2023-02-03 23:25:31 +04:00
|
|
|
|
|
|
|
namespace ConfectioneryView
|
2023-01-30 06:05:58 +04:00
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2023-02-03 23:25:31 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2023-01-30 06:05:58 +04:00
|
|
|
/// <summary>
|
2023-02-03 23:25:31 +04:00
|
|
|
/// The main entry point for the application.
|
2023-01-30 06:05:58 +04:00
|
|
|
/// </summary>
|
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
2023-02-03 23:25:31 +04:00
|
|
|
// To customize application configuration such as set high DPIsettings or default font,
|
2023-01-30 06:05:58 +04:00
|
|
|
// see https://aka.ms/applicationconfiguration.
|
|
|
|
ApplicationConfiguration.Initialize();
|
2023-02-03 23:25:31 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddLogging(option =>
|
|
|
|
{
|
|
|
|
option.SetMinimumLevel(LogLevel.Information);
|
|
|
|
option.AddNLog("nlog.config");
|
|
|
|
});
|
|
|
|
services.AddTransient<IComponentStorage, ComponentStorage>();
|
|
|
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
|
|
|
services.AddTransient<IPastryStorage, PastryStorage>();
|
2023-03-04 16:35:25 +04:00
|
|
|
services.AddTransient<IClientStorage, ClientStorage>();
|
2023-03-06 16:12:04 +04:00
|
|
|
services.AddTransient<IImplementerStorage, ImplementerStorage>();
|
2023-02-05 19:51:51 +04:00
|
|
|
services.AddTransient<IShopStorage, ShopStorage>();
|
2023-03-06 16:12:04 +04:00
|
|
|
|
2023-02-03 23:25:31 +04:00
|
|
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
services.AddTransient<IPastryLogic, PastryLogic>();
|
2023-03-01 16:42:58 +04:00
|
|
|
services.AddTransient<IReportLogic, ReportLogic>();
|
2023-03-04 16:35:25 +04:00
|
|
|
services.AddTransient<IClientLogic, ClientLogic>();
|
2023-02-05 19:51:51 +04:00
|
|
|
services.AddTransient<IShopLogic, ShopLogic>();
|
2023-03-06 16:12:04 +04:00
|
|
|
services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
2023-03-06 16:59:14 +04:00
|
|
|
services.AddTransient<IWorkProcess, WorkModeling>();
|
2023-03-01 16:42:58 +04:00
|
|
|
|
|
|
|
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
|
|
|
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
|
|
|
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
|
|
|
|
2023-02-03 23:25:31 +04:00
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormComponent>();
|
|
|
|
services.AddTransient<FormComponents>();
|
|
|
|
services.AddTransient<FormCreateOrder>();
|
|
|
|
services.AddTransient<FormPastry>();
|
|
|
|
services.AddTransient<FormPastryComponent>();
|
|
|
|
services.AddTransient<FormViewPastry>();
|
2023-02-05 19:51:51 +04:00
|
|
|
services.AddTransient<FormAddPastryInShop>();
|
|
|
|
services.AddTransient<FormViewShops>();
|
2023-02-05 22:16:56 +04:00
|
|
|
services.AddTransient<FormShop>();
|
2023-02-18 20:10:51 +04:00
|
|
|
services.AddTransient<FormSellPastry>();
|
2023-03-02 03:15:42 +04:00
|
|
|
services.AddTransient<FormReportShopPastries>();
|
2023-03-08 16:05:07 +04:00
|
|
|
services.AddTransient<FormReportPastryComponents>();
|
|
|
|
services.AddTransient<FormReportGroupOrders>();
|
2023-03-01 16:42:58 +04:00
|
|
|
services.AddTransient<FormReportOrders>();
|
2023-03-04 16:35:25 +04:00
|
|
|
services.AddTransient<FormViewClients>();
|
2023-03-06 16:12:04 +04:00
|
|
|
services.AddTransient<FormViewImplementers>();
|
|
|
|
services.AddTransient<FormImplementer>();
|
2023-01-30 06:05:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|