diff options
author | emkael <emkael@tlen.pl> | 2018-10-12 20:43:25 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-10-12 20:43:25 +0200 |
commit | 0550305e3f1f2558588b6b87a8c1b4004437ad3b (patch) | |
tree | 7e3ceec0e7b805fdd937535672ce16beffef9b31 /kurier/MysqlSettings.cs | |
parent | 8465d82288402eacf28cba9cff5c29e798005408 (diff) |
MySQL settings
Diffstat (limited to 'kurier/MysqlSettings.cs')
-rw-r--r-- | kurier/MysqlSettings.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/kurier/MysqlSettings.cs b/kurier/MysqlSettings.cs new file mode 100644 index 0000000..01b1b08 --- /dev/null +++ b/kurier/MysqlSettings.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace kurier +{ + public partial class MysqlSettings : Form + { + public MysqlSettings() + { + InitializeComponent(); + } + + private void MysqlSettings_Load(object sender, EventArgs e) + { + eHost.Text = Properties.Settings.Default.HOST; + eUser.Text = Properties.Settings.Default.USER; + ePass.Text = Properties.Settings.Default.PASS; + ePort.Text = Properties.Settings.Default.PORT; + } + + private void button1_Click(object sender, EventArgs e) + { + Properties.Settings.Default.HOST = eHost.Text; + Properties.Settings.Default.USER = eUser.Text; + Properties.Settings.Default.PASS = ePass.Text; + Properties.Settings.Default.PORT = ePort.Text; + + string msg = MySQL.test(); + if (msg == "") + { + Properties.Settings.Default.CONFIGURED = true; + Properties.Settings.Default.Save(); + Close(); + } + else + { + MessageBox.Show(msg, "Nieprawidłowe ustawienia", MessageBoxButtons.OK, MessageBoxIcon.Stop); + } + } + } +} |