コード例 #1
0
        private void proceedbtn_Click(object sender, RoutedEventArgs e)
        {
            var userName = Usernametxtbox.Text;
            var password = Passwordtxtbox.Text;
            var clusterName = Clustertxtbx.Text;
            var connectionObj = new DatabaseOperationsReader();
            connectionObj.AssignCredentialsToDatabase(userName, password, clusterName);
            var isConnected = connectionObj.ConnectToDatabase(DatabaseType.Cassandra);

            if (isConnected)
            {
                Visibility = Visibility.Hidden;
                var win = Window.GetWindow(this);
                var conversionTypeSelection = new ConversionTypeSelection();
                var homePage = (HomePage)(win);
                if (homePage != null) homePage.ContentArea.Content = conversionTypeSelection;
            }
            else
            {
                ErrorLog.Visibility = Visibility.Visible;
                ErrorLog.Content = "Enter correct credentials.";
            }
        }