Files
Kanalsanierungsverwaltung/SanSystem/frmOffsetSet.cs
HuskyTeufel 3a51ada9d6 Generell wird kein doc mehr erzeugt
prüfung ob uv anlage erreichbar ist
2022-03-25 13:42:15 +01:00

43 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SanSystem
{
public partial class frmOffsetSet : Form
{
public DateTime Offset;
public frmOffsetSet(DateTime off)
{
InitializeComponent();
if (off != DateTime.MinValue)
{
txt_offset.Text = off.TimeOfDay.ToString();
dateTimePicker.Value = off;
}
}
private void Btn_save_Click(object sender, EventArgs e)
{
string s = string.Format("{0} {1}", dateTimePicker.Value.ToShortDateString(), txt_offset.Text);
try
{
Offset = DateTime.Parse(s);
}
catch(System.FormatException ex)
{
MessageBox.Show("Fehler beim Datum, es wird das jetzige Datum verwendet\n"+ex.Message);
Offset = DateTime.Now;
}
this.Close();
}
}
}