Code cleanup

Offset werte können nun mit Datum versehen werden
This commit is contained in:
HuskyTeufel
2021-03-11 16:39:26 +01:00
parent db742557a5
commit 09ec9b1cd1
5 changed files with 51 additions and 19 deletions

View File

@@ -14,16 +14,20 @@ namespace SanSystem
public partial class frmOffsetSet : Form
{
public DateTime Offset;
public frmOffsetSet(string Uhrzeit = null)
public frmOffsetSet(DateTime off)
{
InitializeComponent();
if(Uhrzeit != null)
txt_offset.Text = Uhrzeit;
if (off != DateTime.MinValue)
{
txt_offset.Text = off.TimeOfDay.ToString();
dateTimePicker.Value = off;
}
}
private void Btn_save_Click(object sender, EventArgs e)
{
Offset = DateTime.Parse(txt_offset.Text);
string s = string.Format("{0} {1}", dateTimePicker.Value.ToShortDateString(), txt_offset.Text);
Offset = DateTime.Parse(s);
this.Close();
}
}