diff --git a/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs b/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs index 55f1d69..a011de1 100644 --- a/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs +++ b/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs @@ -98,7 +98,7 @@ namespace KlassenBIB } this.Rueckholgeschwindigkeit = 0; } - catch (FileNotFoundException ex) + catch (FileNotFoundException) { //Trace.WriteLine(ex.Message); //MessageBox.Show(string.Format("Datei {0} wurde nicht gefunden", ex.FileName)); @@ -226,7 +226,7 @@ namespace KlassenBIB { grunddaten["TV_Kontrolle"] = string.Format("Ja, am {0}", AnfangAushaertung.Subtract(TimeSpan.FromMinutes(20))); } - catch(ArgumentOutOfRangeException ex) + catch(ArgumentOutOfRangeException) { grunddaten["TV_Kontrolle"] = "UNDEFINIED"; } @@ -239,7 +239,7 @@ namespace KlassenBIB { grunddaten["Lagerung_Text"] = GetLagerungText(DateTime.Parse(imprägnierungsbericht.ImprägnierDatum), this.Datum, lagerungTemperatur); } - catch(NullReferenceException ex) + catch(NullReferenceException) { grunddaten["Lagerung_Text"] = "UNDEFINIED"; } diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs index 7555412..35316cb 100644 --- a/SanSystem/Global.cs +++ b/SanSystem/Global.cs @@ -24,6 +24,8 @@ namespace SanSystem string projektpfad = "18-850"; + public CSVParser.AcceptedCSVFormats AnlageType = CSVParser.AcceptedCSVFormats.BLUELIGHT; + public void BuildNewLinerReste(EventArgs args) { EventHandler handler = RequestBuildNewLinerReste; diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index c1ab325..8ae2320 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -198,7 +198,7 @@ namespace SanSystem private void btn_transfer_ftp_Click(object sender, EventArgs e) { - if (true) + if (Global.Instance.AnlageType == AcceptedCSVFormats.BLUELIGHT) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = @"\\192.168.2.248"; @@ -211,7 +211,7 @@ namespace SanSystem File.Delete(source); } } - else + else if(Global.Instance.AnlageType == AcceptedCSVFormats.UVRELINING) { filenames.Clear(); if (MessageBox.Show("Bitte stellen Sie sicher, dass der Server antwortet und dass nur die Dateien vorhanden sind!, Bitte beachten Sie, dass das fenster einfrieren kann", "WARNUNG", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) == DialogResult.OK) @@ -297,10 +297,10 @@ namespace SanSystem frmOffsetSet frmOffsetSet; if (inliner.Offset != DateTime.MinValue) { - frmOffsetSet = new frmOffsetSet(inliner.Offset.TimeOfDay.ToString()); + frmOffsetSet = new frmOffsetSet(inliner.Offset); } else { - frmOffsetSet = new frmOffsetSet(); + frmOffsetSet = new frmOffsetSet(DateTime.MinValue); } frmOffsetSet.ShowDialog(); inliner.Offset = frmOffsetSet.Offset; diff --git a/SanSystem/frmOffsetSet.Designer.cs b/SanSystem/frmOffsetSet.Designer.cs index 4611388..c91a009 100644 --- a/SanSystem/frmOffsetSet.Designer.cs +++ b/SanSystem/frmOffsetSet.Designer.cs @@ -31,16 +31,18 @@ this.txt_offset = new System.Windows.Forms.MaskedTextBox(); this.label1 = new System.Windows.Forms.Label(); this.btn_save = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.dateTimePicker = new System.Windows.Forms.DateTimePicker(); this.SuspendLayout(); // // txt_offset // this.txt_offset.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txt_offset.Location = new System.Drawing.Point(172, 9); + this.txt_offset.Location = new System.Drawing.Point(172, 83); this.txt_offset.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_offset.Mask = "90:00:00"; this.txt_offset.Name = "txt_offset"; - this.txt_offset.Size = new System.Drawing.Size(229, 30); + this.txt_offset.Size = new System.Drawing.Size(107, 26); this.txt_offset.TabIndex = 0; this.txt_offset.ValidatingType = typeof(System.DateTime); // @@ -48,17 +50,17 @@ // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(18, 14); + this.label1.Location = new System.Drawing.Point(18, 88); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(85, 25); + this.label1.Size = new System.Drawing.Size(71, 20); this.label1.TabIndex = 1; this.label1.Text = "StartZeit"; // // btn_save // this.btn_save.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_save.Location = new System.Drawing.Point(18, 70); + this.btn_save.Location = new System.Drawing.Point(18, 144); this.btn_save.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btn_save.Name = "btn_save"; this.btn_save.Size = new System.Drawing.Size(384, 80); @@ -67,19 +69,41 @@ this.btn_save.UseVisualStyleBackColor = true; this.btn_save.Click += new System.EventHandler(this.Btn_save_Click); // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(18, 38); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(57, 20); + this.label2.TabIndex = 3; + this.label2.Text = "Datum"; + // + // dateTimePicker + // + this.dateTimePicker.CustomFormat = "yyyy"; + this.dateTimePicker.Location = new System.Drawing.Point(172, 38); + this.dateTimePicker.Name = "dateTimePicker"; + this.dateTimePicker.Size = new System.Drawing.Size(275, 26); + this.dateTimePicker.TabIndex = 4; + this.dateTimePicker.Value = new System.DateTime(2021, 3, 11, 12, 12, 12, 0); + // // frmOffsetSet // - this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(435, 171); + this.ClientSize = new System.Drawing.Size(493, 249); this.ControlBox = false; + this.Controls.Add(this.dateTimePicker); + this.Controls.Add(this.label2); this.Controls.Add(this.btn_save); this.Controls.Add(this.label1); this.Controls.Add(this.txt_offset); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "frmOffsetSet"; - this.Text = "frmOffsetSet"; + this.Text = "Offsetwert anpassen"; this.ResumeLayout(false); this.PerformLayout(); @@ -90,5 +114,7 @@ private System.Windows.Forms.MaskedTextBox txt_offset; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btn_save; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.DateTimePicker dateTimePicker; } } \ No newline at end of file diff --git a/SanSystem/frmOffsetSet.cs b/SanSystem/frmOffsetSet.cs index 0218732..7c13182 100644 --- a/SanSystem/frmOffsetSet.cs +++ b/SanSystem/frmOffsetSet.cs @@ -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(); } }