예제 #1
0
        private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            lblMessage.Text = string.Empty;

            if (txtFilename.Text != string.Empty && txtFilename.Text.ToLower().Contains(".skb"))
            {
                ServantKeeperApi.OpenConnection(txtFilename.Text);

                if (ServantKeeperApi.IsConnected)
                {
                    MainWindow mainWindow = new MainWindow();
                    mainWindow.Show();
                    this.Close();
                }
                else
                {
                    lblMessage.Text = $"Could not open the SKB backup file. {ServantKeeperApi.ErrorMessage}";
                }
            }
            else
            {
                lblMessage.Text = "Please choose a SKB backup file.";
            }
        }
예제 #2
0
        private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            lblMessage.Text = string.Empty;

            if (txtFilename.Text != string.Empty)
            {
                ServantKeeperApi.OpenConnection(txtFilename.Text);

                if (ServantKeeperApi.IsConnected)
                {
                    MainWindow mainWindow = new MainWindow();
                    mainWindow.Show();
                    this.Close();
                }
                else
                {
                    lblMessage.Text = $"Could not open the MS Access database file. {ServantKeeperApi.ErrorMessage}";
                }
            }
            else
            {
                lblMessage.Text = "Please choose a MS Access database file.";
            }
        }