MonitoringDB --> TracingDB, TBF ver. 2.18.981

This commit is contained in:
Milan Hanajik
2018-08-28 09:44:39 +02:00
parent bf69524fd8
commit 0ef9505af1
52 changed files with 66 additions and 66 deletions
+119
View File
@@ -0,0 +1,119 @@
using System;
using System.Windows.Forms;
namespace TracingDB.Forms
{
public partial class SettingsDlg : Form
{
static readonly DateTime MinTime = new DateTime(1753, 1, 1, 0, 0, 0);
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 TracingDB.Mode Mode
{
set
{
radioButton1.Checked = (value == TracingDB.Mode.Test);
radioButton2.Checked = (value == TracingDB.Mode.Production);
}
get
{
return radioButton1.Checked ? TracingDB.Mode.Test : TracingDB.Mode.Production;
}
}
public DateTime LogoutTime1
{
get { return timePicker1.Value; }
set { timePicker1.Value = (value.CompareTo(MinTime) < 0) ? MinTime : value; }
}
public DateTime LogoutTime2
{
get { return timePicker2.Value; }
set { timePicker2.Value = (value.CompareTo(MinTime) < 0) ? MinTime : value; }
}
public DateTime LogoutTime3
{
get { return timePicker3.Value; }
set { timePicker3.Value = (value.CompareTo(MinTime) < 0) ? MinTime : value; }
}
/// <summary>
/// Basic configuration dialog
/// </summary>
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
public SettingsDlg(bool isWorkplace)
{
InitializeComponent();
if (isWorkplace)
{
oracleGroupBox.Visible = true;
timeGroupBox.Visible = true;
}
extraBatteryLifetimeTextBox.Text = "0";
timePicker1.Format = DateTimePickerFormat.Custom;
timePicker1.CustomFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern;
timePicker2.Format = DateTimePickerFormat.Custom;
timePicker2.CustomFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern;
timePicker3.Format = DateTimePickerFormat.Custom;
timePicker3.CustomFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern;
}
private void saveButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}