//Conform Password Change
 private void conformPasswordChange(object sender, System.Windows.RoutedEventArgs e)
 {
     NecessaryFunction necessaryElement = new NecessaryFunction();
     if (DatabaseSettingtextboxPassword.Password.Length.Equals(DatabaseSettingtextboxConformPassword.Password.Length))
     {
         if (necessaryElement.PasswordIs(DatabaseSettingtextboxPassword.Password, DatabaseSettingtextboxConformPassword.Password))
         {
             DatabaseSettingPasswordError.Foreground=Brushes.ForestGreen;
             DatabaseSettingPasswordError.Text=Variables.ERROR_MESSAGES[1,2];
         }
         else
         {
             DatabaseSettingPasswordError.Foreground = Brushes.Red;
             DatabaseSettingPasswordError.Text = Variables.ERROR_MESSAGES[0, 6];
         }
     }
     else
     {
         DatabaseSettingPasswordError.Text = string.Empty;
     }
 }
        //check database string
        private void DatabaseSettingConnectButtonClick(object sender, System.Windows.RoutedEventArgs e)
        {
            MySqlNaceassaryElement mysqlNecessaryFunction = new MySqlNaceassaryElement();
            NecessaryFunction necessaryElement = new NecessaryFunction();
            this.DatabaseSettingConnectButton.IsEnabled = false;
            if (DatabaseSettingtextboxUsername.Text != string.Empty && DatabaseSettingtextboxPassword.Password != string.Empty && DatabaseSettingtextboxConformPassword.Password != string.Empty && DatabaseSettingtextboxHostIP.Text != string.Empty && DatabaseSettingtextboxPortNumber.Text != string.Empty && DatabaseSettingtextboxPortNumber.Text != string.Empty && DatabaseSettingtextboxDatabaseName.Text != string.Empty && necessaryElement.PasswordIs(DatabaseSettingtextboxPassword.Password, DatabaseSettingtextboxConformPassword.Password))
            {
                if (mysqlNecessaryFunction.ConnectToMysql(this.DatabaseSettingtextboxDatabaseName.Text,this.DatabaseSettingtextboxHostIP.Text,this.DatabaseSettingtextboxPortNumber.Text,this.DatabaseSettingtextboxUsername.Text,this.DatabaseSettingtextboxConformPassword.Password))
                {
                    Properties.Settings.Default.DatabaseServerip = this.DatabaseSettingtextboxHostIP.Text;
                    Properties.Settings.Default.DatabasePortNumber = this.DatabaseSettingtextboxPortNumber.Text;
                    Properties.Settings.Default.DarabaseDefultDatabase = this.DatabaseSettingtextboxDatabaseName.Text;
                    Properties.Settings.Default.DatabaseUserName = this.DatabaseSettingtextboxUsername.Text;
                    Properties.Settings.Default.DatabasePassword = DatabaseSettingtextboxConformPassword.Password;
                    Properties.Settings.Default.Save();
                    Microsoft.Windows.Controls.MessageBox.Show(ProcestaVariables.Variables.ERROR_MESSAGES[0, 8], ProcestaVariables.Variables.ERROR_MESSAGES[0, 0], MessageBoxButton.OK, MessageBoxImage.Information);
                    System.Windows.Forms.Application.Restart();
                    Application.Current.Shutdown();

                }
                else
                {
                    Microsoft.Windows.Controls.MessageBox.Show(ProcestaVariables.Variables.ERROR_MESSAGES[0, 1], ProcestaVariables.Variables.ERROR_MESSAGES[0, 0], MessageBoxButton.OK, MessageBoxImage.Error);
                    this.DatabaseSettingConnectButton.IsEnabled = true;
                }

            }
            else
            {
                Microsoft.Windows.Controls.MessageBox.Show(ProcestaVariables.Variables.ERROR_MESSAGES[0, 1] + Environment.NewLine + ProcestaVariables.Variables.ERROR_MESSAGES[0, 7], ProcestaVariables.Variables.ERROR_MESSAGES[0, 0], MessageBoxButton.OK, MessageBoxImage.Stop);
                this.DatabaseSettingConnectButton.IsEnabled = true;
            }
        }