88 lines
2.2 KiB
C#
88 lines
2.2 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace MonitoringDB.Forms
|
|
{
|
|
public partial class SettingsDlg : Form
|
|
{
|
|
public string WorkplaceName
|
|
{
|
|
set { workplaceNameTextBox.Text = value; }
|
|
get { return workplaceNameTextBox.Text; }
|
|
}
|
|
|
|
public string ConnectionString
|
|
{
|
|
set { connectionStringTextBox.Text = value; }
|
|
get { return connectionStringTextBox.Text; }
|
|
}
|
|
|
|
public string UsersDBConnString
|
|
{
|
|
set { usersDBConnStringTextBox.Text = value; }
|
|
get { return usersDBConnStringTextBox.Text; }
|
|
}
|
|
|
|
public bool OracleBattery
|
|
{
|
|
set { oracleBatteryCheckBox.Checked = value; }
|
|
get { return oracleBatteryCheckBox.Checked; }
|
|
}
|
|
|
|
public bool CheckPcbIsInOracle
|
|
{
|
|
set { checkPcbIsInOracleCheckBox.Checked = value; }
|
|
get { return checkPcbIsInOracleCheckBox.Checked; }
|
|
}
|
|
|
|
public int ExtraBatterLifetime
|
|
{
|
|
get
|
|
{
|
|
int extraLifetime;
|
|
if (int.TryParse(extraBatteryLifetimeTextBox.Text, out extraLifetime) && extraLifetime >= 0) return extraLifetime;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public MonitoringDB.Mode Mode
|
|
{
|
|
set
|
|
{
|
|
radioButton1.Checked = (value == MonitoringDB.Mode.Test);
|
|
radioButton2.Checked = (value == MonitoringDB.Mode.Production);
|
|
}
|
|
get
|
|
{
|
|
return radioButton1.Checked ? MonitoringDB.Mode.Test : MonitoringDB.Mode.Production;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Basic configuration dialog
|
|
/// </summary>
|
|
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
|
|
public SettingsDlg(bool isWorkplace)
|
|
{
|
|
InitializeComponent();
|
|
if (isWorkplace)
|
|
{
|
|
oracleGroupBox.Visible = true;
|
|
}
|
|
extraBatteryLifetimeTextBox.Text = "0";
|
|
}
|
|
|
|
private void saveButton_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
|
|
private void cancelButton_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.Cancel;
|
|
Close();
|
|
}
|
|
}
|
|
}
|