From bba6f37e9270c002b6e220700878e24871203646 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Mon, 10 Oct 2022 09:27:39 +0200 Subject: [PATCH] Exception-Handling verfeinert, kleine Bugfixes. --- Aviso/frmEintragAviso.vb | 3 +- Aviso/frmHauptfenster.Designer.vb | 68 +++++++++-------------- Aviso/frmNCTSRouten.Designer.vb | 52 ++++++++--------- Aviso/frmNCTSRouten.vb | 10 +++- Aviso/frmRoutendauerBerechnen.Designer.vb | 18 +----- Aviso/frmRoutendauerBerechnen.resx | 3 - Aviso/frmRoutendauerBerechnen.vb | 42 +++++++------- 7 files changed, 88 insertions(+), 108 deletions(-) diff --git a/Aviso/frmEintragAviso.vb b/Aviso/frmEintragAviso.vb index 2857b35..db9778e 100644 --- a/Aviso/frmEintragAviso.vb +++ b/Aviso/frmEintragAviso.vb @@ -1848,10 +1848,9 @@ Public Class frmEintragAviso If destination Is "" Or destination Is Nothing Then MsgBox("Zur Berechnung muss vorher eine Grenzstelle/Zollstelle ausgewählt werden!") Else - Dim frmGrayOut = VERAG_PROG_ALLGEMEIN.cMeineFunktionenAVISO.grayoutForm() Dim frmRouteBerechnen = New frmRoutendauerBerechnen(destination) - If frmRouteBerechnen.ShowDialog(frmGrayOut) = DialogResult.OK Then + If frmRouteBerechnen.ShowDialog() = DialogResult.OK Then datVoraussichtlichesEintreffen.Value = frmRouteBerechnen.calculatedDate End If diff --git a/Aviso/frmHauptfenster.Designer.vb b/Aviso/frmHauptfenster.Designer.vb index 4777098..1074e15 100644 --- a/Aviso/frmHauptfenster.Designer.vb +++ b/Aviso/frmHauptfenster.Designer.vb @@ -71,6 +71,7 @@ Partial Class frmHauptfenster Me.SDLProgrammStartenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.TESTToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.AlleStatusMailsSchickenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.RoutenverwaltungToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() Me.FirmaWechselnToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.VERAGToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -353,8 +354,6 @@ Partial Class frmHauptfenster Me.GüterlisteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Timer_REFRESH = New System.Windows.Forms.Timer(Me.components) Me.UsrCntlTestsystem1 = New VERAG_PROG_ALLGEMEIN.usrCntlTestsystem() - Me.MyLinkLabelVALUE1 = New VERAG_PROG_ALLGEMEIN.MyLinkLabelVALUE() - Me.RoutenverwaltungToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.Top.SuspendLayout() @@ -635,6 +634,12 @@ Partial Class frmHauptfenster Me.AlleStatusMailsSchickenToolStripMenuItem.Size = New System.Drawing.Size(209, 22) Me.AlleStatusMailsSchickenToolStripMenuItem.Text = "Alle Status Mails schicken" ' + 'RoutenverwaltungToolStripMenuItem + ' + Me.RoutenverwaltungToolStripMenuItem.Name = "RoutenverwaltungToolStripMenuItem" + Me.RoutenverwaltungToolStripMenuItem.Size = New System.Drawing.Size(209, 22) + Me.RoutenverwaltungToolStripMenuItem.Text = "Routenverwaltung" + ' 'ToolStripSeparator4 ' Me.ToolStripSeparator4.Name = "ToolStripSeparator4" @@ -1999,7 +2004,7 @@ Partial Class frmHauptfenster Me.SplitContainer2.Panel2.Controls.Add(Me.SplitContainer3) Me.SplitContainer2.Panel2MinSize = 650 Me.SplitContainer2.Size = New System.Drawing.Size(815, 300) - Me.SplitContainer2.SplitterDistance = 108 + Me.SplitContainer2.SplitterDistance = 111 Me.SplitContainer2.SplitterWidth = 1 Me.SplitContainer2.TabIndex = 0 ' @@ -2016,7 +2021,7 @@ Partial Class frmHauptfenster Me.pnlLinks.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlLinks.Location = New System.Drawing.Point(0, 86) Me.pnlLinks.Name = "pnlLinks" - Me.pnlLinks.Size = New System.Drawing.Size(108, 214) + Me.pnlLinks.Size = New System.Drawing.Size(111, 214) Me.pnlLinks.TabIndex = 0 ' 'lblFimaAviso @@ -2041,7 +2046,7 @@ Partial Class frmHauptfenster Me.Panel2.Dock = System.Windows.Forms.DockStyle.Top Me.Panel2.Location = New System.Drawing.Point(0, 0) Me.Panel2.Name = "Panel2" - Me.Panel2.Size = New System.Drawing.Size(108, 111) + Me.Panel2.Size = New System.Drawing.Size(111, 111) Me.Panel2.TabIndex = 10 ' 'Label7 @@ -2063,7 +2068,7 @@ Partial Class frmHauptfenster Me.lblErrVermerk.ForeColor = System.Drawing.Color.Red Me.lblErrVermerk.Location = New System.Drawing.Point(12, 158) Me.lblErrVermerk.Name = "lblErrVermerk" - Me.lblErrVermerk.Size = New System.Drawing.Size(81, 27) + Me.lblErrVermerk.Size = New System.Drawing.Size(84, 27) Me.lblErrVermerk.TabIndex = 1 Me.lblErrVermerk.Text = "Bei diesem Status kann kein Vermerk erfasst werden!" Me.lblErrVermerk.TextAlign = System.Drawing.ContentAlignment.BottomLeft @@ -2138,7 +2143,7 @@ Partial Class frmHauptfenster Me.pnlLinksOben.Dock = System.Windows.Forms.DockStyle.Top Me.pnlLinksOben.Location = New System.Drawing.Point(0, 0) Me.pnlLinksOben.Name = "pnlLinksOben" - Me.pnlLinksOben.Size = New System.Drawing.Size(108, 86) + Me.pnlLinksOben.Size = New System.Drawing.Size(111, 86) Me.pnlLinksOben.TabIndex = 1 ' 'Label22 @@ -2213,8 +2218,8 @@ Partial Class frmHauptfenster 'SplitContainer3.Panel2 ' Me.SplitContainer3.Panel2.Controls.Add(Me.pnl) - Me.SplitContainer3.Size = New System.Drawing.Size(706, 300) - Me.SplitContainer3.SplitterDistance = 173 + Me.SplitContainer3.Size = New System.Drawing.Size(703, 300) + Me.SplitContainer3.SplitterDistance = 172 Me.SplitContainer3.TabIndex = 3 ' 'UsrCntlBenachrichtigungen1 @@ -2223,19 +2228,18 @@ Partial Class frmHauptfenster Me.UsrCntlBenachrichtigungen1.Location = New System.Drawing.Point(0, 0) Me.UsrCntlBenachrichtigungen1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.UsrCntlBenachrichtigungen1.Name = "UsrCntlBenachrichtigungen1" - Me.UsrCntlBenachrichtigungen1.Size = New System.Drawing.Size(173, 300) + Me.UsrCntlBenachrichtigungen1.Size = New System.Drawing.Size(172, 300) Me.UsrCntlBenachrichtigungen1.TabIndex = 0 ' 'pnl ' - Me.pnl.Controls.Add(Me.MyLinkLabelVALUE1) Me.pnl.Controls.Add(Me.Button10) Me.pnl.Controls.Add(Me.gridMyAviso) Me.pnl.Controls.Add(Me.Panel6) Me.pnl.Dock = System.Windows.Forms.DockStyle.Fill Me.pnl.Location = New System.Drawing.Point(0, 0) Me.pnl.Name = "pnl" - Me.pnl.Size = New System.Drawing.Size(529, 300) + Me.pnl.Size = New System.Drawing.Size(527, 300) Me.pnl.TabIndex = 0 ' 'Button10 @@ -2293,7 +2297,7 @@ Partial Class frmHauptfenster Me.gridMyAviso.RowHeadersDefaultCellStyle = DataGridViewCellStyle4 Me.gridMyAviso.RowHeadersVisible = False Me.gridMyAviso.RowHeadersWidth = 62 - Me.gridMyAviso.Size = New System.Drawing.Size(529, 277) + Me.gridMyAviso.Size = New System.Drawing.Size(527, 277) Me.gridMyAviso.TabIndex = 0 ' 'Panel6 @@ -2311,7 +2315,7 @@ Partial Class frmHauptfenster Me.Panel6.Dock = System.Windows.Forms.DockStyle.Top Me.Panel6.Location = New System.Drawing.Point(0, 0) Me.Panel6.Name = "Panel6" - Me.Panel6.Size = New System.Drawing.Size(529, 21) + Me.Panel6.Size = New System.Drawing.Size(527, 21) Me.Panel6.TabIndex = 1 ' 'lblMeineAviso @@ -2337,7 +2341,7 @@ Partial Class frmHauptfenster Me.cboMy_Grenzstelle.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.cboMy_Grenzstelle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!) Me.cboMy_Grenzstelle.FormattingEnabled = True - Me.cboMy_Grenzstelle.Location = New System.Drawing.Point(154, 1) + Me.cboMy_Grenzstelle.Location = New System.Drawing.Point(152, 1) Me.cboMy_Grenzstelle.Name = "cboMy_Grenzstelle" Me.cboMy_Grenzstelle.Size = New System.Drawing.Size(64, 21) Me.cboMy_Grenzstelle.TabIndex = 26 @@ -2347,7 +2351,7 @@ Partial Class frmHauptfenster Me.Label18.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.Label18.AutoSize = True Me.Label18.ForeColor = System.Drawing.Color.White - Me.Label18.Location = New System.Drawing.Point(86, 4) + Me.Label18.Location = New System.Drawing.Point(84, 4) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(62, 13) Me.Label18.TabIndex = 25 @@ -2358,7 +2362,7 @@ Partial Class frmHauptfenster Me.cbx_My_LKW.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cbx_My_LKW.AutoSize = True Me.cbx_My_LKW.ForeColor = System.Drawing.Color.White - Me.cbx_My_LKW.Location = New System.Drawing.Point(30, 3) + Me.cbx_My_LKW.Location = New System.Drawing.Point(28, 3) Me.cbx_My_LKW.Name = "cbx_My_LKW" Me.cbx_My_LKW.Size = New System.Drawing.Size(50, 17) Me.cbx_My_LKW.TabIndex = 24 @@ -2372,7 +2376,7 @@ Partial Class frmHauptfenster Me.cboMy_QS.Checked = True Me.cboMy_QS.CheckState = System.Windows.Forms.CheckState.Indeterminate Me.cboMy_QS.ForeColor = System.Drawing.Color.White - Me.cboMy_QS.Location = New System.Drawing.Point(416, 3) + Me.cboMy_QS.Location = New System.Drawing.Point(414, 3) Me.cboMy_QS.Name = "cboMy_QS" Me.cboMy_QS.Size = New System.Drawing.Size(15, 14) Me.cboMy_QS.TabIndex = 23 @@ -2386,7 +2390,7 @@ Partial Class frmHauptfenster Me.cboMy_VB.Checked = True Me.cboMy_VB.CheckState = System.Windows.Forms.CheckState.Indeterminate Me.cboMy_VB.ForeColor = System.Drawing.Color.White - Me.cboMy_VB.Location = New System.Drawing.Point(437, 3) + Me.cboMy_VB.Location = New System.Drawing.Point(435, 3) Me.cboMy_VB.Name = "cboMy_VB" Me.cboMy_VB.Size = New System.Drawing.Size(15, 14) Me.cboMy_VB.TabIndex = 22 @@ -2404,7 +2408,7 @@ Partial Class frmHauptfenster Me.cboMyAvisoAnzeige.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.cboMyAvisoAnzeige.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!) Me.cboMyAvisoAnzeige.FormattingEnabled = True - Me.cboMyAvisoAnzeige.Location = New System.Drawing.Point(273, 1) + Me.cboMyAvisoAnzeige.Location = New System.Drawing.Point(271, 1) Me.cboMyAvisoAnzeige.Name = "cboMyAvisoAnzeige" Me.cboMyAvisoAnzeige.Size = New System.Drawing.Size(127, 21) Me.cboMyAvisoAnzeige.TabIndex = 21 @@ -2414,7 +2418,7 @@ Partial Class frmHauptfenster Me.Label17.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.Label17.AutoSize = True Me.Label17.ForeColor = System.Drawing.Color.White - Me.Label17.Location = New System.Drawing.Point(224, 3) + Me.Label17.Location = New System.Drawing.Point(222, 3) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(48, 13) Me.Label17.TabIndex = 20 @@ -2424,7 +2428,7 @@ Partial Class frmHauptfenster ' Me.lblAkte.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.lblAkte.ForeColor = System.Drawing.Color.White - Me.lblAkte.Location = New System.Drawing.Point(802, 6) + Me.lblAkte.Location = New System.Drawing.Point(800, 6) Me.lblAkte.Name = "lblAkte" Me.lblAkte.Size = New System.Drawing.Size(207, 19) Me.lblAkte.TabIndex = 1 @@ -3390,24 +3394,6 @@ Partial Class frmHauptfenster Me.UsrCntlTestsystem1.Size = New System.Drawing.Size(152, 28) Me.UsrCntlTestsystem1.TabIndex = 8 ' - 'MyLinkLabelVALUE1 - ' - Me.MyLinkLabelVALUE1.AutoSize = True - Me.MyLinkLabelVALUE1.linkedTextBox = Nothing - Me.MyLinkLabelVALUE1.Location = New System.Drawing.Point(191, 99) - Me.MyLinkLabelVALUE1.Name = "MyLinkLabelVALUE1" - Me.MyLinkLabelVALUE1.Size = New System.Drawing.Size(108, 13) - Me.MyLinkLabelVALUE1.TabIndex = 3 - Me.MyLinkLabelVALUE1.TabStop = True - Me.MyLinkLabelVALUE1.Text = "MyLinkLabelVALUE1" - Me.MyLinkLabelVALUE1.valuename = Nothing - ' - 'RoutenverwaltungToolStripMenuItem - ' - Me.RoutenverwaltungToolStripMenuItem.Name = "RoutenverwaltungToolStripMenuItem" - Me.RoutenverwaltungToolStripMenuItem.Size = New System.Drawing.Size(209, 22) - Me.RoutenverwaltungToolStripMenuItem.Text = "Routenverwaltung" - ' 'frmHauptfenster ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -3451,7 +3437,6 @@ Partial Class frmHauptfenster CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainer3.ResumeLayout(False) Me.pnl.ResumeLayout(False) - Me.pnl.PerformLayout() CType(Me.gridMyAviso, System.ComponentModel.ISupportInitialize).EndInit() Me.Panel6.ResumeLayout(False) Me.Panel6.PerformLayout() @@ -3801,5 +3786,4 @@ Partial Class frmHauptfenster Friend WithEvents EmbargosLänderToolStripMenuItem As ToolStripMenuItem Friend WithEvents GüterlisteToolStripMenuItem As ToolStripMenuItem Friend WithEvents RoutenverwaltungToolStripMenuItem As ToolStripMenuItem - Friend WithEvents MyLinkLabelVALUE1 As VERAG_PROG_ALLGEMEIN.MyLinkLabelVALUE End Class diff --git a/Aviso/frmNCTSRouten.Designer.vb b/Aviso/frmNCTSRouten.Designer.vb index 76bdc3e..579a403 100644 --- a/Aviso/frmNCTSRouten.Designer.vb +++ b/Aviso/frmNCTSRouten.Designer.vb @@ -28,6 +28,7 @@ Partial Class frmNCTSRouten Me.btnNeu = New System.Windows.Forms.Button() Me.btnSave = New System.Windows.Forms.Button() Me.pnlNCTSRouten = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) + Me.txtVonRegion = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.lblWarningTransportmittel = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.cbxTransportmittel = New VERAG_PROG_ALLGEMEIN.MyComboBox() @@ -48,7 +49,6 @@ Partial Class frmNCTSRouten Me.txtDauer = New System.Windows.Forms.TextBox() Me.cbxRoutenart = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.dgvNCTSRouten = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) - Me.txtVonRegion = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.pnlNCTSRouten.SuspendLayout() CType(Me.dgvNCTSRouten, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() @@ -119,6 +119,31 @@ Partial Class frmNCTSRouten Me.pnlNCTSRouten.Size = New System.Drawing.Size(491, 197) Me.pnlNCTSRouten.TabIndex = 30 ' + 'txtVonRegion + ' + Me.txtVonRegion._DateTimeOnly = False + Me.txtVonRegion._numbersOnly = False + Me.txtVonRegion._numbersOnlyKommastellen = "" + Me.txtVonRegion._numbersOnlyTrennzeichen = True + Me.txtVonRegion._Prozent = False + Me.txtVonRegion._ShortDateNew = False + Me.txtVonRegion._ShortDateOnly = False + Me.txtVonRegion._TimeOnly = False + Me.txtVonRegion._TimeOnly_Seconds = False + Me.txtVonRegion._value = "" + Me.txtVonRegion._Waehrung = False + Me.txtVonRegion._WaehrungZeichen = True + Me.txtVonRegion.Enabled = False + Me.txtVonRegion.ForeColor = System.Drawing.Color.Black + Me.txtVonRegion.Location = New System.Drawing.Point(104, 91) + Me.txtVonRegion.MaxLineLength = -1 + Me.txtVonRegion.MaxLines_Warning = "" + Me.txtVonRegion.MaxLines_Warning_Label = Nothing + Me.txtVonRegion.Name = "txtVonRegion" + Me.txtVonRegion.ReadOnly = True + Me.txtVonRegion.Size = New System.Drawing.Size(67, 20) + Me.txtVonRegion.TabIndex = 43 + ' 'lblWarningTransportmittel ' Me.lblWarningTransportmittel.AutoSize = True @@ -398,31 +423,6 @@ Partial Class frmNCTSRouten Me.dgvNCTSRouten.Size = New System.Drawing.Size(541, 243) Me.dgvNCTSRouten.TabIndex = 10 ' - 'txtVonRegion - ' - Me.txtVonRegion._DateTimeOnly = False - Me.txtVonRegion._numbersOnly = False - Me.txtVonRegion._numbersOnlyKommastellen = "" - Me.txtVonRegion._numbersOnlyTrennzeichen = True - Me.txtVonRegion._Prozent = False - Me.txtVonRegion._ShortDateNew = False - Me.txtVonRegion._ShortDateOnly = False - Me.txtVonRegion._TimeOnly = False - Me.txtVonRegion._TimeOnly_Seconds = False - Me.txtVonRegion._value = "" - Me.txtVonRegion._Waehrung = False - Me.txtVonRegion._WaehrungZeichen = True - Me.txtVonRegion.Enabled = False - Me.txtVonRegion.ForeColor = System.Drawing.Color.Black - Me.txtVonRegion.Location = New System.Drawing.Point(104, 91) - Me.txtVonRegion.MaxLineLength = -1 - Me.txtVonRegion.MaxLines_Warning = "" - Me.txtVonRegion.MaxLines_Warning_Label = Nothing - Me.txtVonRegion.Name = "txtVonRegion" - Me.txtVonRegion.ReadOnly = True - Me.txtVonRegion.Size = New System.Drawing.Size(67, 20) - Me.txtVonRegion.TabIndex = 43 - ' 'frmNCTSRouten ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/Aviso/frmNCTSRouten.vb b/Aviso/frmNCTSRouten.vb index ca9a061..37026f9 100644 --- a/Aviso/frmNCTSRouten.vb +++ b/Aviso/frmNCTSRouten.vb @@ -1,5 +1,6 @@  Imports System.Security.Authentication.ExtendedProtection +Imports DocumentFormat.OpenXml.Drawing Imports GrapeCity.ActiveReports.Document.Section Imports VERAG_PROG_ALLGEMEIN @@ -7,7 +8,7 @@ Imports VERAG_PROG_ALLGEMEIN Public Class frmNCTSRouten Dim routenId As Integer = -1 - Private sql As New VERAG_PROG_ALLGEMEIN.SQL + Dim sql As New VERAG_PROG_ALLGEMEIN.SQL Dim currentRoute As New VERAG_PROG_ALLGEMEIN.cNCTSRouten Public FIRMA_TMP As String = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA @@ -239,6 +240,7 @@ Public Class frmNCTSRouten Private Sub sbxVon_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles sbxVon.PreviewKeyDown If sender Is sbxVon Then sbxVon.FireReturn() : e.IsInputKey = True : Me.DialogResult = DialogResult.None If sender Is sbxNach Then sbxNach.FireReturn() : e.IsInputKey = True : Me.DialogResult = DialogResult.None + End Sub Public Function GetTxtDauer() As TextBox @@ -328,5 +330,11 @@ Public Class frmNCTSRouten searchbox.Visible = visible End Sub + Sub cbxNach_ValueChanged() Handles sbxNach.VALUE_CHANGED + If cbxNach._value = "???" AndAlso sbxNach._value <> "" Then + txtNach.Text = sbxNach._value + End If + End Sub + End Class diff --git a/Aviso/frmRoutendauerBerechnen.Designer.vb b/Aviso/frmRoutendauerBerechnen.Designer.vb index c9753ac..3c247a4 100644 --- a/Aviso/frmRoutendauerBerechnen.Designer.vb +++ b/Aviso/frmRoutendauerBerechnen.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class frmRoutendauerBerechnen Inherits System.Windows.Forms.Form 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,7 +20,7 @@ Partial Class frmRoutendauerBerechnen 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - _ + Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmRoutendauerBerechnen)) Me.btnMinus = New System.Windows.Forms.Button() @@ -39,7 +39,6 @@ Partial Class frmRoutendauerBerechnen Me.lblDauer = New System.Windows.Forms.Label() Me.lblberechneteDauer = New System.Windows.Forms.Label() Me.lbWarningDateIsPast = New System.Windows.Forms.Label() - Me.Button1 = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'btnMinus @@ -241,21 +240,11 @@ Partial Class frmRoutendauerBerechnen Me.lbWarningDateIsPast.Text = "Datum des Eintreffens liegt in der Verangenheit!" Me.lbWarningDateIsPast.Visible = False ' - 'Button1 - ' - Me.Button1.Location = New System.Drawing.Point(144, 13) - Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(29, 23) - Me.Button1.TabIndex = 27 - Me.Button1.Text = "-" - Me.Button1.UseVisualStyleBackColor = True - ' 'frmRoutendauerBerechnen ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(317, 208) - Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.lbWarningDateIsPast) Me.Controls.Add(Me.lblberechneteDauer) Me.Controls.Add(Me.lblDauer) @@ -297,5 +286,4 @@ Partial Class frmRoutendauerBerechnen Friend WithEvents lblDauer As Label Friend WithEvents lblberechneteDauer As Label Friend WithEvents lbWarningDateIsPast As Label - Friend WithEvents Button1 As Button End Class diff --git a/Aviso/frmRoutendauerBerechnen.resx b/Aviso/frmRoutendauerBerechnen.resx index cba375e..0733774 100644 --- a/Aviso/frmRoutendauerBerechnen.resx +++ b/Aviso/frmRoutendauerBerechnen.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - diff --git a/Aviso/frmRoutendauerBerechnen.vb b/Aviso/frmRoutendauerBerechnen.vb index 7f1bcd2..c410614 100644 --- a/Aviso/frmRoutendauerBerechnen.vb +++ b/Aviso/frmRoutendauerBerechnen.vb @@ -1,5 +1,6 @@ Imports System.CodeDom Imports DocumentFormat.OpenXml.Bibliography +Imports DocumentFormat.OpenXml.Drawing Imports Org.BouncyCastle.Utilities Imports SDL Imports Therefore.API @@ -36,19 +37,25 @@ Public Class frmRoutendauerBerechnen txtNach.Text = destination destinationShortcut = findDestinationAndReplaceToShortCut(destination) - initComboboxDeparture() + If destinationShortcut = "" Then + initComboboxDeparture(destination) + Else + initComboboxDeparture(destinationShortcut) + End If + txbAbgangsdatum._value = "" - - End Sub - Sub initComboboxDeparture() + Sub initComboboxDeparture(destination As String) cbxVon.Items.Clear() - cbxVon.fillWithSQL("SELECT [nctsr_von], [nctsr_von_region] FROM [tblNTCSRouten] WHERE [nctsr_nach] = '" & destinationShortcut & "'", False, "FMZOLL", False) + cbxVon.fillWithSQL("SELECT [nctsr_von], [nctsr_von_region] FROM [tblNTCSRouten] WHERE [nctsr_nach] = '" & destination & "'", False, "FMZOLL", False) cbxVon.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", "")) cbxVon.changeItem("") + If cbxVon._value = "" Then + MsgBox("Es wurde für die Bestimmungszollstelle " & txtNach.Text & " keine Route definiert." & vbCrLf & "Bitte voraus. Datum des Eintreffens manuell eingeben!") + End If End Sub @@ -67,17 +74,14 @@ Public Class frmRoutendauerBerechnen checkIfDepatureDateIsNotPast() End Sub - Function calculateTripDuration() As Integer + Function lookUpTripDuration() As Integer - 'Dim destination As String Dim departure As String departure = cbxVon._value - 'destination = txtNach.Text - Try - days = CInt(SQL.DLookup("nctsr_dauer_in_tagen", "tblNTCSRouten", "[nctsr_von]='" & departure & "' AND [nctsr_nach]= '" & destinationShortcut & "' AND [nctsr_route]= 'Landweg' AND [nctsr_transportmittel]= '" & transportmittel & "'", "VERAG", -1)) + days = CInt(SQL.DLookup("nctsr_dauer_in_tagen", "tblNTCSRouten", "[nctsr_von]='" & departure & "' AND [nctsr_nach]= '" & destinationShortcut & "' AND [nctsr_route]= 'Landweg' AND [nctsr_transportmittel]= '" & transportmittel & "'", "VERAG", 0)) Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) End Try @@ -101,8 +105,7 @@ Public Class frmRoutendauerBerechnen Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click calculatedDate = CDate(txbVoraussichtlichesEintreffen._value) - ' Close() - 'btnOK.DialogResult = DialogResult.OK + End Sub Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click @@ -113,12 +116,10 @@ Public Class frmRoutendauerBerechnen If checkIfDepartureDateIsFilled() = False Then Exit Sub - - days = calculateTripDuration() + days = lookUpTripDuration() calcDays = days - - If days > 0 Then + If days >= 0 Then addDaysToGivenDate(txbAbgangsdatum, days) End If @@ -139,12 +140,13 @@ Public Class frmRoutendauerBerechnen Else + lblWarning.Visible = False isFilled = True lblDauer.Visible = True btnOK.DialogResult = DialogResult.OK - calcDuration() + End If @@ -177,7 +179,7 @@ Public Class frmRoutendauerBerechnen End Function - Function calcDuration() + Function calcDuration() As Integer Dim result As Integer = 0 If txbVoraussichtlichesEintreffen._value <> "" Then @@ -186,12 +188,14 @@ Public Class frmRoutendauerBerechnen result = (EndDate - StartDate).Days If (result < 0) Then MsgBox("Transportdauer kann nicht negativ sein!") + btnOK.DialogResult = DialogResult.None Else + btnOK.DialogResult = DialogResult.OK End If End If - Return result + Return result End Function