Example #1
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            System.Windows.Controls.TextBox SqlConnectionTextBox = (System.Windows.Controls.TextBox) this.FindName("SqlConnectionTextBox");
            System.Windows.Controls.TextBox CloneRepoTextBox     = (System.Windows.Controls.TextBox) this.FindName("CloneRepoTextBox");

            if (ImportSQL.ImportSQLScripts(SqlConnectionTextBox.Text, CloneRepoTextBox.Text))
            {
                CountrySetup countrySetupWindow = new CountrySetup(SqlConnectionTextBox.Text, CloneRepoTextBox.Text);
                countrySetupWindow.Show();
                this.Close();
            }
        }
Example #2
0
        private void CreateAdminAccount(string username, string password)
        {
            try
            {
                System.Windows.Controls.Button NextButton = (System.Windows.Controls.Button) this.FindName("NextButton");
                ImportSQL.ImportAdminCredentials(connectionString, username, password, CountryIds);
                MessageBox.Show("Success! Administrator account created for all countries/sites.");

                NextButton.IsEnabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        private void ImportButton_Click(object sender, RoutedEventArgs e)
        {
            CountryName         = (System.Windows.Controls.TextBox) this.FindName("CountryNameTextBox");
            CountryPath         = (System.Windows.Controls.TextBox) this.FindName("CountryPathTextBox");
            CountryAbbreviation = (System.Windows.Controls.TextBox) this.FindName("CountryAbbreviationTextBox");
            Languages           = (System.Windows.Controls.ComboBox) this.FindName("LanguageComboBox");
            NextButton          = (System.Windows.Controls.Button) this.FindName("NextButton");

            if (ValidateForm(CountryName.Text, CountryPath.Text, CountryAbbreviation.Text))
            {
                var         selectedTag        = ((ComboBoxItem)Languages.SelectedItem).Tag.ToString();
                var         selectedName       = ((ComboBoxItem)Languages.SelectedItem).Content.ToString();
                CultureInfo defaultCultureInfo = new CultureInfo(selectedTag);

                Guid countryId = ImportSQL.ImportCountryAndDefaultLanguage(_connectionString,
                                                                           new CountryLanguageModel
                {
                    CountryAbbreviation = CountryAbbreviation.Text,
                    CountryName         = CountryName.Text,
                    CountryPath         = CountryPath.Text,
                    LanguageName        = selectedName,
                    LanguageShortName   = selectedName,
                    LCID = defaultCultureInfo.LCID
                }
                                                                           );

                if (countryId != null && countryId != Guid.Empty)
                {
                    NextButton.IsEnabled = true;
                    CountryIds.Add(countryId);

                    CountryNameTextBox.Clear();
                    CountryPathTextBox.Clear();
                    CountryAbbreviationTextBox.Clear();

                    MessageBox.Show("Success!");
                }
                else
                {
                    MessageBox.Show("Country import was not succesfull.");
                }
            }
        }