-
Notifications
You must be signed in to change notification settings - Fork 1
/
FrmSettings.cs
59 lines (52 loc) · 2.04 KB
/
FrmSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace BaharNarenjERP
{
public partial class FrmSettings : Form
{
public FrmSettings()
{
InitializeComponent();
}
private void FrmSettings_Load(object sender, EventArgs e)
{
TxtPort.Text = Properties.Settings.Default.Port.ToString();
TxtDeliveryDifference.Text = Properties.Settings.Default.DeliveryDifference.ToString();
}
private void BtnApply_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Server = TxtServer.Text;
Properties.Settings.Default.Port = Convert.ToUInt32(TxtPort.Text);
Properties.Settings.Default.UserID = TxtUserId.Text;
Properties.Settings.Default.Password = TxtPassword.Text;
Properties.Settings.Default.DataBase = TxtDatebase.Text;
Properties.Settings.Default.CompanyName = TxtCompanyName.Text;
Properties.Settings.Default.EndNote = TxtEndNote.Text;
Properties.Settings.Default.TimeServer = TxtTimeServer.Text;
Properties.Settings.Default.DeliveryDifference = Convert.ToInt32(TxtDeliveryDifference.Text);
Properties.Settings.Default.Save();
}
private void BtnConTest_Click(object sender, EventArgs e)
{
var cn = new MySqlConnection(new MySqlConnectionStringBuilder
{
Server = TxtServer.Text,
Port = Convert.ToUInt32(TxtPort.Text),
UserID = TxtUserId.Text,
Password = TxtPassword.Text,
Database = TxtDatebase.Text
}.ConnectionString);
DAC.TestConnection(cn);
}
private void BtnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void BtnOk_Click(object sender, EventArgs e)
{
BtnApply_Click(sender, e);
Close();
}
}
}