NCTS_FREMD

This commit is contained in:
2024-12-26 09:15:36 +01:00
parent 69370afc13
commit 955ae80d62
7 changed files with 834 additions and 764 deletions

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.5.1")>
<Assembly: AssemblyFileVersion("1.0.5.1")>
<Assembly: AssemblyVersion("1.0.5.3")>
<Assembly: AssemblyFileVersion("1.0.5.3")>

View File

@@ -370,10 +370,39 @@ Public Class cBrgDb
End Function
Public Function loadDgvBySqlFromBrgKtoDAKOSYDetails004(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As DataTable
Dim sql As String = "SELECT ncts_MRN,ncts_Status,[nctsGRT_AmountToBeCovered]nctsSA_AbgabenBetrag,[nctsGRT_AmountToBeCovered], ncts_dyaAnmID, ncts_Declarationtype ncts_ArtAnmeldung,ncts_ArtAnmeldung,[nctsGRT_GRN] nctsSA_GRN,ncts_Consignee_IdentificationNumber ncts_Empfaenger_eori,ncts_Consignee_SubsidiaryNumber ncts_Empfaenger_NLNR,ncts_Empfaenger_Name,ncts_Bearbeiter"
Dim sql As String = "SELECT ncts_MRN,ncts_Status,[nctsGRT_AmountToBeCovered]nctsSA_AbgabenBetrag,[nctsGRT_AmountToBeCovered], ncts_dyaAnmID, ncts_Declarationtype ncts_ArtAnmeldung,ncts_Declarationtype,[nctsGRT_GRN] nctsSA_GRN,ncts_Consignee_IdentificationNumber ncts_Empfaenger_eori,ncts_Consignee_SubsidiaryNumber ncts_Empfaenger_NLNR,ncts_Consignee_Name,ncts_Bearbeiter"
sql &= " ,[ncts_ObjectName],[ncts_Trans_DatumZeit] as Transaktionsdatum,[ncts_dyaArt],[ncts_ANR],[ncts_MRN],[ncts_ObjectAlias],ncts_GrossMass ncts_GesamtRohmasse,0 As ncts_GesamtAnzahlPackstuecke "
sql &= " from tblDakosy_NCTSOut004_Guarantee inner join [tblDakosy_NCTSOut004] on ncts_Id = nctsGRT_NctsId"
sql &= " where ncts_Status between '" & statusVon & "' and '" & statusBis & "' AND nctsSA_GRN='" & buergschaft & "' " & where
sql &= " where ncts_Status between '" & statusVon & "' and '" & statusBis & "' AND nctsGRT_GRN='" & buergschaft & "' " & where
'MsgBox(sql)
While True 'Endlosschleife; wird verlassen durch Return oder Application.Exit()
Try
Dim myTable = New DataTable()
Using conn As SqlConnection = VERAG_PROG_ALLGEMEIN.SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand(sql, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader()
myTable.Load(dr)
dr.Close()
End Using
conn.Close()
End Using
Return myTable 'While Schleife wird hier verlassen
Catch ex As Exception
Dim antwort As MsgBoxResult = MsgBox(ex.Message, CType(MsgBoxStyle.RetryCancel + MsgBoxStyle.Exclamation, MsgBoxStyle),
"Problem in Function 'loadDgvBySqlZOLARIS'")
End Try
End While
Return Nothing
End Function
Public Function loadDgvBySqlFromBrgKt_NCTS_FREMD_Details(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As DataTable
Dim sql As String = "SELECT ncts_MRN,ncts_Status,[nctsGRT_AmountToBeCovered]nctsSA_AbgabenBetrag,[nctsGRT_AmountToBeCovered], ncts_dyaAnmID, ncts_Declarationtype ncts_ArtAnmeldung,ncts_Declarationtype,[nctsGRT_GRN] nctsSA_GRN,ncts_Consignee_IdentificationNumber ncts_Empfaenger_eori,ncts_Consignee_SubsidiaryNumber ncts_Empfaenger_NLNR,ncts_Consignee_Name,ncts_Bearbeiter"
sql &= " ,[ncts_ObjectName],[ncts_Eroeffnung] as Transaktionsdatum,[ncts_dyaArt],[ncts_ANR],[ncts_MRN],[ncts_ObjectAlias],ncts_GrossMass ncts_GesamtRohmasse,0 As ncts_GesamtAnzahlPackstuecke "
sql &= " from tblNCTS_FREMD_Guarantee inner join [tblNCTS_FREMD] on ncts_Id = nctsGRT_NctsId"
sql &= " where ncts_Status between '" & statusVon & "' and '" & statusBis & "' AND nctsGRT_GRN='" & buergschaft & "' " & where
'MsgBox(sql)
While True 'Endlosschleife; wird verlassen durch Return oder Application.Exit()
Try
@@ -614,7 +643,8 @@ Public Class cBrgDb
Public Function getBrgSumFromFMZOLL_NCTS_TR(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As String
Dim tmp_DY As String = getBrgSumFrom_NCTS_TR(datumVon, datumBis, statusVon, statusBis, buergschaft, where)
Return CDbl(tmp_DY)
Dim tmp_FREMD As String = getBrgSumFrom_NCTS_FREMD(datumVon, datumBis, statusVon, statusBis, buergschaft, where)
Return CDbl(tmp_DY) + CDbl(tmp_FREMD)
End Function
@@ -716,6 +746,39 @@ Public Class cBrgDb
End Function
Public Function getBrgSumFrom_NCTS_FREMD(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As String
'Return Nothing
Dim sql As String = "SELECT sum([nctsGRT_AmountToBeCovered])"
sql &= " from [tblNCTS_FREMD_Guarantee] inner join [tblNCTS_FREMD] on ncts_Id = nctsGRT_NctsId"
sql &= " where [ncts_Eroeffnung] BETWEEN '" & datumVon.ToShortDateString & " 00:00:00' AND '" & datumBis.ToShortDateString & " 23:23:59' AND ncts_Status BETWEEN '" & statusVon & "' AND '" & statusBis & "' AND [nctsGRT_GRN] = '" & buergschaft & "' " & where
'MsgBox(sql)
Dim dr As SqlDataReader
Dim daten As New List(Of cBuergschaft)
Using conn As SqlConnection = VERAG_PROG_ALLGEMEIN.SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand(sql, conn)
dr = cmd.ExecuteReader()
Try
Dim cnt As Integer = 0
If dr.Read Then
If Not dr.GetValue(0) Is DBNull.Value Then
' MsgBox(dr.GetValue(0))
Return dr.GetValue(0)
End If
End If
Return "0"
Catch ex As Exception
MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Fehler mit der Datenbankverbindung:" & vbCrLf & vbCrLf & ex.Message, vbExclamation, "Datenbankfehler")
Finally
dr.Close()
End Try
End Using
End Using
Return Nothing
End Function
Public Function getBrgSumFrom_NCTS_TR(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As String
'Return Nothing
Dim sql As String = "SELECT sum(nctsSA_AbgabenBetrag)"
@@ -747,6 +810,8 @@ Public Class cBrgDb
Return Nothing
End Function
Public Function getBrgSumFrom_TELOTEC(ByVal datumVon As DateTime, ByVal datumBis As DateTime, ByVal statusVon As String, ByVal statusBis As String, ByVal buergschaft As String, Optional where As String = "") As String
'Return Nothing
Dim sql As String = " SELECT sum(tblTelotec_Sicherheit.GVal)

View File

@@ -36,6 +36,7 @@ Partial Class frmShowData
Me.Button1 = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.TabPage5 = New System.Windows.Forms.TabPage()
CType(Me.dgv, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.tbcntr.SuspendLayout()
@@ -49,12 +50,11 @@ Partial Class frmShowData
Me.dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader
Me.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgv.Dock = System.Windows.Forms.DockStyle.Fill
Me.dgv.Location = New System.Drawing.Point(0, 85)
Me.dgv.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.dgv.Location = New System.Drawing.Point(0, 55)
Me.dgv.Name = "dgv"
Me.dgv.ReadOnly = True
Me.dgv.RowHeadersWidth = 62
Me.dgv.Size = New System.Drawing.Size(1584, 1278)
Me.dgv.Size = New System.Drawing.Size(1056, 831)
Me.dgv.TabIndex = 1
'
'Panel1
@@ -67,27 +67,24 @@ Partial Class frmShowData
Me.Panel1.Controls.Add(Me.Label1)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(0, 0)
Me.Panel1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(1584, 85)
Me.Panel1.Size = New System.Drawing.Size(1056, 55)
Me.Panel1.TabIndex = 2
'
'datBIS
'
Me.datBIS.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.datBIS.Location = New System.Drawing.Point(672, 20)
Me.datBIS.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.datBIS.Location = New System.Drawing.Point(448, 13)
Me.datBIS.Name = "datBIS"
Me.datBIS.Size = New System.Drawing.Size(139, 26)
Me.datBIS.Size = New System.Drawing.Size(94, 20)
Me.datBIS.TabIndex = 4
'
'datVON
'
Me.datVON.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.datVON.Location = New System.Drawing.Point(368, 20)
Me.datVON.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.datVON.Location = New System.Drawing.Point(245, 13)
Me.datVON.Name = "datVON"
Me.datVON.Size = New System.Drawing.Size(139, 26)
Me.datVON.Size = New System.Drawing.Size(94, 20)
Me.datVON.TabIndex = 4
'
'tbcntr
@@ -99,73 +96,67 @@ Partial Class frmShowData
Me.tbcntr.Controls.Add(Me.TabPage3)
Me.tbcntr.Controls.Add(Me.TabPage4)
Me.tbcntr.Controls.Add(Me.NCTS_TR)
Me.tbcntr.Location = New System.Drawing.Point(0, 48)
Me.tbcntr.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.tbcntr.Controls.Add(Me.TabPage5)
Me.tbcntr.Location = New System.Drawing.Point(0, 31)
Me.tbcntr.Name = "tbcntr"
Me.tbcntr.SelectedIndex = 0
Me.tbcntr.Size = New System.Drawing.Size(1580, 40)
Me.tbcntr.Size = New System.Drawing.Size(1053, 26)
Me.tbcntr.TabIndex = 3
'
'TabPage2
'
Me.TabPage2.Location = New System.Drawing.Point(4, 29)
Me.TabPage2.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage2.Location = New System.Drawing.Point(4, 22)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Padding = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage2.Size = New System.Drawing.Size(1572, 7)
Me.TabPage2.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3)
Me.TabPage2.Size = New System.Drawing.Size(1045, 0)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "DAKOSY"
Me.TabPage2.UseVisualStyleBackColor = True
'
'TabPage1
'
Me.TabPage1.Location = New System.Drawing.Point(4, 29)
Me.TabPage1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage1.Location = New System.Drawing.Point(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Padding = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage1.Size = New System.Drawing.Size(1572, 7)
Me.TabPage1.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3)
Me.TabPage1.Size = New System.Drawing.Size(1045, 0)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "BLUJAY"
Me.TabPage1.UseVisualStyleBackColor = True
'
'TabPage3
'
Me.TabPage3.Location = New System.Drawing.Point(4, 29)
Me.TabPage3.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage3.Location = New System.Drawing.Point(4, 22)
Me.TabPage3.Name = "TabPage3"
Me.TabPage3.Size = New System.Drawing.Size(1572, 7)
Me.TabPage3.Size = New System.Drawing.Size(1045, 0)
Me.TabPage3.TabIndex = 2
Me.TabPage3.Text = "EZOLL"
Me.TabPage3.UseVisualStyleBackColor = True
'
'TabPage4
'
Me.TabPage4.Location = New System.Drawing.Point(4, 29)
Me.TabPage4.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage4.Location = New System.Drawing.Point(4, 22)
Me.TabPage4.Name = "TabPage4"
Me.TabPage4.Padding = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TabPage4.Size = New System.Drawing.Size(1572, 7)
Me.TabPage4.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3)
Me.TabPage4.Size = New System.Drawing.Size(1045, 0)
Me.TabPage4.TabIndex = 3
Me.TabPage4.Text = "TELOTEC"
Me.TabPage4.UseVisualStyleBackColor = True
'
'NCTS_TR
'
Me.NCTS_TR.Location = New System.Drawing.Point(4, 29)
Me.NCTS_TR.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.NCTS_TR.Location = New System.Drawing.Point(4, 22)
Me.NCTS_TR.Name = "NCTS_TR"
Me.NCTS_TR.Padding = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.NCTS_TR.Size = New System.Drawing.Size(1572, 7)
Me.NCTS_TR.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3)
Me.NCTS_TR.Size = New System.Drawing.Size(1045, 0)
Me.NCTS_TR.TabIndex = 4
Me.NCTS_TR.Text = "NCTS_FREMD"
Me.NCTS_TR.Text = "NCTS_TR"
Me.NCTS_TR.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(898, 8)
Me.Button1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button1.Location = New System.Drawing.Point(599, 5)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(184, 35)
Me.Button1.Size = New System.Drawing.Size(123, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "In Excel konvertieren"
Me.Button1.TextAlign = System.Drawing.ContentAlignment.TopCenter
@@ -174,10 +165,9 @@ Partial Class frmShowData
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(1434, 14)
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Location = New System.Drawing.Point(956, 9)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(62, 20)
Me.Label2.Size = New System.Drawing.Size(42, 13)
Me.Label2.TabIndex = 0
Me.Label2.Text = "Anzahl:"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.TopCenter
@@ -186,22 +176,29 @@ Partial Class frmShowData
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(4, 14)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Location = New System.Drawing.Point(3, 9)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(111, 20)
Me.Label1.Size = New System.Drawing.Size(75, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Datensätze:"
'
'TabPage5
'
Me.TabPage5.Location = New System.Drawing.Point(4, 22)
Me.TabPage5.Name = "TabPage5"
Me.TabPage5.Size = New System.Drawing.Size(1045, 0)
Me.TabPage5.TabIndex = 5
Me.TabPage5.Text = "NCTS_FREMD"
Me.TabPage5.UseVisualStyleBackColor = True
'
'frmShowData
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1584, 1363)
Me.ClientSize = New System.Drawing.Size(1056, 886)
Me.Controls.Add(Me.dgv)
Me.Controls.Add(Me.Panel1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "frmShowData"
Me.Text = "Details"
CType(Me.dgv, System.ComponentModel.ISupportInitialize).EndInit()
@@ -224,4 +221,5 @@ Partial Class frmShowData
Friend WithEvents datVON As System.Windows.Forms.DateTimePicker
Friend WithEvents TabPage4 As TabPage
Friend WithEvents NCTS_TR As TabPage
Friend WithEvents TabPage5 As TabPage
End Class

View File

@@ -85,7 +85,7 @@ Public Class frmShowData
Case "BRG"
Select Case tbcntr.SelectedIndex
Case 0 'DY
dgv.DataSource = BRG.loadDgvBySqlFromBrgKtoDAKOSYDetails(datVON.Value.ToShortDateString, datBIS.Value.ToShortDateString, "50", "50", BRG_GRN)
dgv.DataSource = BRG.loadDgvBySqlFromBrgKtoDAKOSYDetails004(datVON.Value.ToShortDateString, datBIS.Value.ToShortDateString, "50", "50", BRG_GRN)
If dgv.Columns.Count > 0 Then
dgv.Columns("nctsSA_AbgabenBetrag").DefaultCellStyle.Format = "N2"
dgv.Columns("ncts_GesamtRohmasse").DefaultCellStyle.Format = "N2"
@@ -129,6 +129,16 @@ Public Class frmShowData
dgv.Columns("ncts_GesamtRohmasse").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
dgv.Columns("ncts_GesamtAnzahlPackstuecke").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
End If
Case 5 'NCTS_FREMD
dgv.DataSource = BRG.loadDgvBySqlFromBrgKt_NCTS_FREMD_Details(datVON.Value.ToShortDateString, datBIS.Value.ToShortDateString, "50", "50", BRG_GRN)
If dgv.Columns.Count > 0 Then
dgv.Columns("nctsSA_AbgabenBetrag").DefaultCellStyle.Format = "N2"
dgv.Columns("ncts_GesamtRohmasse").DefaultCellStyle.Format = "N2"
dgv.Columns("ncts_GesamtAnzahlPackstuecke").DefaultCellStyle.Format = "N0"
dgv.Columns("nctsSA_AbgabenBetrag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
dgv.Columns("ncts_GesamtRohmasse").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
dgv.Columns("ncts_GesamtAnzahlPackstuecke").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
End If
End Select
Case "AUFSCHUB"
End Select