2023-04-05 09:49:33 +04:00
|
|
|
using HospitalBusinessLogic.BusinessLogics;
|
|
|
|
using HospitalContracts.BusinessLogicsContracts;
|
|
|
|
using HospitalContracts.StoragesContracts;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NLog.Extensions.Logging;
|
|
|
|
using System;
|
|
|
|
|
2023-04-04 09:51:08 +04:00
|
|
|
namespace HospitalView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2023-04-05 09:49:33 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2023-04-04 09:51:08 +04:00
|
|
|
[STAThread]
|
|
|
|
static void Main()
|
|
|
|
{
|
|
|
|
ApplicationConfiguration.Initialize();
|
2023-04-05 09:49:33 +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<IIllnessStorage, IllnessStorage>();
|
|
|
|
//services.AddTransient<ISymptomsStorage, SymptomsStorage>();
|
|
|
|
//services.AddTransient<IMedicinesStorage, MedicinesStorage>();
|
|
|
|
//services.AddTransient<IProceduresStorage, ProceduresStorage>();
|
|
|
|
//services.AddTransient<IRecipesStorage, RecipesStorage>();
|
|
|
|
//services.AddTransient<IKurseStorage, KurseStorage>();
|
|
|
|
services.AddTransient<IIllnessLogic, IllnessLogic>();
|
|
|
|
services.AddTransient<ISymptomsLogic, SymptomsLogic>();
|
|
|
|
services.AddTransient<IMedicinesLogic, MedicinesLogic>();
|
|
|
|
services.AddTransient<IProceduresLogic, ProceduresLogic>();
|
|
|
|
services.AddTransient<IRecipesLogic, RecipesLogic>();
|
|
|
|
services.AddTransient<IKurseLogic, KurseLogic>();
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormProcedure>();
|
|
|
|
services.AddTransient<FormProcedures>();
|
|
|
|
services.AddTransient<FormMedicine>();
|
|
|
|
services.AddTransient<FormMedicines>();
|
|
|
|
//services.AddTransient<FormGiftComponent>();
|
|
|
|
//services.AddTransient<FormGifts>();
|
2023-04-04 09:51:08 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|