53 lines
2.0 KiB
C#
53 lines
2.0 KiB
C#
using static System.Windows.Forms.DataFormats;
|
|
using System;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using HotelAbstractions.Logic;
|
|
using HotelDatabase.Implement;
|
|
using HotelMongoDB.StorageContracts;
|
|
using HotelMongoDB;
|
|
|
|
namespace HotelView
|
|
{
|
|
internal static class Program
|
|
{
|
|
private static ServiceProvider? _serviceProvider;
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
|
|
|
public static bool isPostgreSQL = true;
|
|
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
// To customize application configuration such as set high DPI settings or default font,
|
|
// see https://aka.ms/applicationconfiguration.
|
|
ApplicationConfiguration.Initialize();
|
|
var services = new ServiceCollection();
|
|
ConfigureServices(services);
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
}
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
{
|
|
services.AddTransient<IHotelLogic, HotelImplement>();
|
|
services.AddTransient<IRoomLogic, RoomImplement>();
|
|
services.AddTransient<IReservationLogic, ReservationImplement>();
|
|
services.AddTransient<IGuestLogic, GuestImplement>();
|
|
services.AddTransient<IServiceCheckLogic, ServiceCheckImplement>();
|
|
services.AddTransient<IServiceLogic, ServiceImplement>();
|
|
|
|
services.AddTransient<StorageModel, MongoDBImplement>();
|
|
|
|
services.AddTransient<FormMain>();
|
|
services.AddTransient<FormHotel>();
|
|
services.AddTransient<FormGuest>();
|
|
services.AddTransient<FormService>();
|
|
services.AddTransient<FormReservation>();
|
|
services.AddTransient<FormServiceCheck>();
|
|
services.AddTransient<FormRoom>();
|
|
}
|
|
}
|
|
} |