App.xaml.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Windows;
  2. using AGEHAB.RelatorioSeadIpasgo.Application.UseCases;
  3. using AGEHAB.RelatorioSeadIpasgo.Domain.Services;
  4. using AGEHAB.RelatorioSeadIpasgo.Infrastructure.Database;
  5. using AGEHAB.RelatorioSeadIpasgo.Infrastructure.Excel;
  6. using AGEHAB.RelatorioSeadIpasgo.Infrastructure.Zip;
  7. using AGEHAB.RelatorioSeadIpasgo.Presentation;
  8. using AGEHAB.RelatorioSeadIpasgo.Presentation.Services;
  9. using AGEHAB.RelatorioSeadIpasgo.Presentation.ViewModels;
  10. namespace AGEHAB.RelatorioSeadIpasgo;
  11. public partial class App : System.Windows.Application
  12. {
  13. protected override void OnStartup(StartupEventArgs e)
  14. {
  15. base.OnStartup(e);
  16. const string connectionString = "Server=10.6.57.33; initial catalog=ERP_RH_AGEHAB; User Id=usr_pld; Password=Consulta01; MultipleActiveResultSets=true; TrustServerCertificate=True";
  17. var repository = new RelatorioRepository(connectionString);
  18. var filtroIpasgoService = new FiltroIpasgoService();
  19. var excelWriter = new ExcelRelatorioWriter();
  20. var zipWriter = new IpasgoZipWriter();
  21. var carregarCompetenciasUseCase = new CarregarCompetenciasUseCase(repository);
  22. var gerarRelatorioUseCase = new GerarRelatorioUseCase(repository, filtroIpasgoService, excelWriter, zipWriter);
  23. var dialogService = new UserDialogService();
  24. var viewModel = new MainViewModel(carregarCompetenciasUseCase, gerarRelatorioUseCase, dialogService);
  25. var window = new MainWindow(viewModel);
  26. window.Show();
  27. }
  28. }