Пример #1
0
        private void SaveSettings_Click(object sender, RoutedEventArgs e)
        {
            if (FormalCheckup())
            {
                if (!string.IsNullOrEmpty(txtApiKey.Text))
                {
                    dbHelper.SaveSettings("ApiKey", txtApiKey.Text);
                    txtApiKey.Text = "";
                }

                if (!string.IsNullOrEmpty(txtApiSecret.Text))
                {
                    dbHelper.SaveSettings("ApiSecret", txtApiSecret.Text);
                    txtApiSecret.Text = "";
                }

                string TradingLimitPerPair = string.IsNullOrEmpty(txtTradingLimitPerPair.Text) ? MinTradingLimitPerPair.ToString() : txtTradingLimitPerPair.Text;
                dbHelper.SaveSettings("TradingLimitPerPair", TradingLimitPerPair);

                ShowMessageBox("Settings Saved", "Smart bot settings saved successfully!", MessageBoxImage.Information);
            }
        }