52 lines
1.2 KiB
C#
52 lines
1.2 KiB
C#
|
|
///
|
|||
|
|
/// Copyright (c) 2017 Sensus Metering Systems
|
|||
|
|
///
|
|||
|
|
using System;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using UserManagement.Resources;
|
|||
|
|
|
|||
|
|
namespace UserManagement
|
|||
|
|
{
|
|||
|
|
public partial class DatabaseSettingsDlg : Form
|
|||
|
|
{
|
|||
|
|
public DatabaseSettingsDlg()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void DatabaseSettings_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Localize();
|
|||
|
|
|
|||
|
|
connectionStringTextBox1.Text = Program.LocalSettings.ConnectionString;
|
|||
|
|
languageTextBox.Text = Program.LocalSettings.Language;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Localize()
|
|||
|
|
{
|
|||
|
|
Text = Strings.Settings;
|
|||
|
|
connectionStringLabel.Text = Strings.Connection_string;
|
|||
|
|
languageLabel.Text = Strings.Language;
|
|||
|
|
okButton.Text = Strings.OkBtnText;
|
|||
|
|
cancelButton.Text = Strings.CancelBtnText;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void okButton_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Program.LocalSettings.ConnectionString = connectionStringTextBox1.Text;
|
|||
|
|
Program.LocalSettings.Language = languageTextBox.Text;
|
|||
|
|
|
|||
|
|
Program.LocalSettings.Save();
|
|||
|
|
|
|||
|
|
DialogResult = DialogResult.OK;
|
|||
|
|
Close();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void cancelButton_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
DialogResult = DialogResult.Cancel;
|
|||
|
|
Close();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|