ustv
This commit is contained in:
@@ -1666,7 +1666,8 @@ Public Class frmMDM_USTVAntrag
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'check if already existing 'überschneidungen prüfen!!!!
|
'Start neue Version
|
||||||
|
'check if already existing 'überschneidungen prüfen!!!! -> jz wieder doch nicht..........
|
||||||
|
|
||||||
Dim StringSQL As String = "SELECT
|
Dim StringSQL As String = "SELECT
|
||||||
UStVAn_ID,
|
UStVAn_ID,
|
||||||
@@ -1690,12 +1691,15 @@ Public Class frmMDM_USTVAntrag
|
|||||||
|
|
||||||
Dim dt_existingUSTVA As DataTable = SQL.loadDgvBySql(StringSQL, "FMZOLL")
|
Dim dt_existingUSTVA As DataTable = SQL.loadDgvBySql(StringSQL, "FMZOLL")
|
||||||
|
|
||||||
|
'Ende neue Version
|
||||||
|
|
||||||
|
'alte Version wieder aktiviert.
|
||||||
|
'Start alte Version --------------------------------------
|
||||||
|
|
||||||
'Dim dt_existingUSTVA As DataTable = SQL.loadDgvBySql("Select UStVAn_ID,UStVAn_ReDatvon, UStVAn_ReDatBis, UStVAn_AntragEingereichtAm from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
'Dim dt_existingUSTVA As DataTable = SQL.loadDgvBySql("Select UStVAn_ID,UStVAn_ReDatvon, UStVAn_ReDatBis, UStVAn_AntragEingereichtAm from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
||||||
' AND not ((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' or cast(UStVAn_ReDatBis as date) <= '" & CDate(txtVon._value).ToShortDateString & "' ) and (cast(UStVAn_ReDatBis as date) < '" & CDate(txtBis._value).ToShortDateString & "' or cast(UStVAn_ReDatvon as date) >= '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL")
|
' AND not ((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' or cast(UStVAn_ReDatBis as date) <= '" & CDate(txtVon._value).ToShortDateString & "' ) and (cast(UStVAn_ReDatBis as date) < '" & CDate(txtBis._value).ToShortDateString & "' or cast(UStVAn_ReDatvon as date) >= '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL")
|
||||||
|
|
||||||
'Dim anzUSTVA = CInt((New SQL).getValueTxtBySql("Select count(*) from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
'Ende alte Version --------------------------------------
|
||||||
' AND not ((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' and cast(UStVAn_ReDatBis as date) <= '" & CDate(txtVon._value).ToShortDateString & "') or (cast(UStVAn_ReDatvon as date) < '" & CDate(txtBis._value).ToShortDateString & "' and cast(UStVAn_ReDatBis as date) >= '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL"))
|
|
||||||
|
|
||||||
If dt_existingUSTVA.Rows.Count = 1 Then
|
If dt_existingUSTVA.Rows.Count = 1 Then
|
||||||
|
|
||||||
@@ -1714,13 +1718,33 @@ Public Class frmMDM_USTVAntrag
|
|||||||
|
|
||||||
ElseIf dt_existingUSTVA.Rows.Count > 1 Then
|
ElseIf dt_existingUSTVA.Rows.Count > 1 Then
|
||||||
Dim testInfo As String = "Es existieren bereits " & dt_existingUSTVA.Rows.Count & " " & cboAntragArt._value & "-Einträge in diesem Zeitbereich von " & vbNewLine
|
Dim testInfo As String = "Es existieren bereits " & dt_existingUSTVA.Rows.Count & " " & cboAntragArt._value & "-Einträge in diesem Zeitbereich von " & vbNewLine
|
||||||
|
Dim IDnichteingereicht As Integer = -1
|
||||||
For Each r In dt_existingUSTVA.Rows
|
For Each r In dt_existingUSTVA.Rows
|
||||||
testInfo &= vbNewLine & r.Item("UStVAn_ReDatvon") & " - " & r.Item("UStVAn_ReDatbis") & IIf(Not IsDBNull(r.Item("UStVAn_AntragEingereichtAm")) AndAlso IsDate(r.Item("UStVAn_AntragEingereichtAm")), " bereits eingereicht! ", "")
|
testInfo &= vbNewLine & r.Item("UStVAn_ReDatvon") & " - " & r.Item("UStVAn_ReDatbis") & IIf(Not IsDBNull(r.Item("UStVAn_AntragEingereichtAm")) AndAlso IsDate(r.Item("UStVAn_AntragEingereichtAm")), " bereits eingereicht! ", "")
|
||||||
|
|
||||||
|
If IsDBNull(r.Item("UStVAn_AntragEingereichtAm")) OrElse IsDate(r.Item("UStVAn_AntragEingereichtAm")) Then
|
||||||
|
IDnichteingereicht = (r.Item("UStVAn_ID"))
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
testInfo &= vbNewLine & vbNewLine & "von " & ADR.Name_1 & " für " & cbxLand.SelectedItem.ToString
|
testInfo &= vbNewLine & vbNewLine & "von " & ADR.Name_1 & " für " & cbxLand.SelectedItem.ToString
|
||||||
|
|
||||||
If Not vbYes = MsgBox(testInfo & vbNewLine & "Trotzdem Antrag speichern?", vbYesNoCancel) Then Exit Sub
|
Dim result As MsgBoxResult = MsgBox(testInfo & vbNewLine & "Ja = Antrag speichern" & vbNewLine & "Nein = existierenden Antrag öffnen", vbYesNoCancel)
|
||||||
|
Select Case result
|
||||||
|
Case MsgBoxResult.Cancel : Exit Sub
|
||||||
|
Case MsgBoxResult.No
|
||||||
|
Me.Close()
|
||||||
|
If IDnichteingereicht > 0 Then
|
||||||
|
Dim frm = New frmMDM_USTVAntrag(IDnichteingereicht)
|
||||||
|
frm.ShowDialog()
|
||||||
|
Exit Sub
|
||||||
|
Else
|
||||||
|
'Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user