public LoginViewModel(LoginView loginView, IMessageBoxService messageBoxService)
        {
            _loginView         = loginView;
            CmdLogin           = new DelegateCommand(OnCmdLogin, OnCanLogin);
            CmdAbbrechen       = new DelegateCommand(OnCmdAbbrechen);
            _messegaBoxService = messageBoxService;

            List <MetadataItem> list          = new List <MetadataItem>();
            IImportService      importService = new ImportService();
            IExportService      exportService = new ExportService();
            IFileService        fileService   = new FileService(_messegaBoxService);
            ISearchService      searchService = new SearchService();

            _documentManagementService = new DocumentManagementService(list, messageBoxService, importService, exportService, fileService, searchService);
            _documentManagementService.RepositoryExists();
        }
        private void OnCmdLogin()
        {
            if (string.IsNullOrEmpty(Benutzername))
            {
                _messegaBoxService.Show("Bitte tragen Sie einen Benutzernamen ein...");
                return;
            }

            if (_documentManagementService.RepositoryExists())
            {
                _documentManagementService.ImportArchiv();
                var searchView = new MainView(Benutzername, _documentManagementService, _messegaBoxService);
                searchView.Show();

                _loginView.Close();
            }
        }
Exemple #3
0
        public void RepositoryExists_CheckRepositoryPath_False()
        {
            // arrange
            ConfigurationManager.AppSettings.Set("RepositoryDir", "C:\\asdfasdfasdfafecdscs\\DMS\\");
            var messegaBoxService = new MessageBoxServiceForTesting();
            var importService     = new ImportServiceForTesting(true);
            var exportService     = new ExportServiceForTesting(true);
            var fileService       = new FileServiceForTesting(true, true, true, false);
            var searchService     = new SearchServiceForTesting(true, true, true);
            var itemlist          = new List <MetadataItem>();
            var DMS = new DocumentManagementService(itemlist, messegaBoxService, importService, exportService, fileService, searchService);

            // act
            var result = DMS.RepositoryExists();

            // assert
            Assert.That(result, Is.EqualTo(false));
        }
Exemple #4
0
        public void RepositoryExists_DeleteBackslashAtTheEndIfExist_StringWithoutBackslash()
        {
            // arrange
            ConfigurationManager.AppSettings.Set("RepositoryDir", "C:\\Temp\\DMS\\");
            var messegaBoxService = new MessageBoxServiceForTesting();
            var importService     = new ImportServiceForTesting(true);
            var exportService     = new ExportServiceForTesting(true);
            var fileService       = new FileServiceForTesting(true, true, true, true);
            var searchService     = new SearchServiceForTesting(true, true, true);
            var itemlist          = new List <MetadataItem>();
            var DMS = new DocumentManagementService(itemlist, messegaBoxService, importService, exportService, fileService, searchService);

            // act
            DMS.RepositoryExists();

            // assert
            Assert.That(ConfigurationManager.AppSettings["RepositoryDir"], Is.EqualTo("C:\\Temp\\DMS"));
        }