示例#1
0
        private void ConnectDatabase(object parameter)
        {
            log.Debug("Connect to database");

            if (DatabaseConnection.ChangeDatabase(Directory, DbName))
            {
                NotificationProvider.Info("Connected to:", ConnectedFile);
                SetupWindow?.Close();
            }
            else
            {
                NotificationProvider.Error("Connection error", "Database connection failed.");
            }
            RaisePropertyChanged("ConnectionState");
            RaisePropertyChanged("ConnectedFile");
        }
示例#2
0
        private void CreateDatabase(object parameter)
        {
            log.Debug("Create database");

            if (DatabaseConnection.CreateDatabase(Directory, DbName))
            {
                RaisePropertyChanged("ConnectionState");
                RaisePropertyChanged("ConnectedFile");
                CollectDbNames(Directory);
                NotificationProvider.Info("Database created", "New database: " + DbName);
                NotificationProvider.Info("Connected to:", ConnectedFile);
                SetupWindow?.Close();
            }
            else
            {
                NotificationProvider.Error("New database error", "Database creation failed.");
            }
        }