This commit is contained in:
2021-09-07 08:46:12 +02:00
parent f2f992547d
commit 619a8c26bf
126 changed files with 7156 additions and 2215 deletions

View File

@@ -105,13 +105,13 @@ Public Class cSMS
cmd.Parameters.AddWithValue("@sms_id", sms_id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each l In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(l.Scalarvariable)
For Each i In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(i.Scalarvariable)
If dr.Item(l.Text) Is DBNull.Value Then
If dr.Item(i.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(l.Text))
propInfo.SetValue(Me, dr.Item(i.Text))
End If
Next
@@ -185,9 +185,9 @@ Public Class cSMS
Me.sms_BatchId = result.BatchId
If result.MessageIds IsNot Nothing Then
For Each m In result.MessageIds
Uris &= m.Uri & ";;"
msgIDs &= m.Id.ToString & ";;"
For Each msg In result.MessageIds
Uris &= msg.Uri & ";;"
msgIDs &= msg.Id.ToString & ";;"
Next
End If
Catch ex As Exception
@@ -213,30 +213,100 @@ Public Class cSMS
End Try
End Function
Function checkSMSStatus() As String
Function checkSMSStatus(Optional silent = False) As String
Try
If Me.sms_Status >= 3 Then Return Me.sms_Status ' Bereits finaler Status, keine Abfrage nötig
If If(Me.sms_MessageIds, "") = "" Then MsgBox("Keine MessageId gefunden!") : Return False ' Keine MsgId
If If(Me.sms_MessageIds, "") = "" Then
If Not silent Then MsgBox("Keine MessageId gefunden!")
Return False ' Keine MsgId
End If
Dim sendService As New SentService(ESENDEX_USER, ESENDEX_PWD)
'Send a message and retrieve the message ID
Dim MSG = sendService.GetMessage(New Guid(Me.sms_MessageIds.ToString))
Dim messageStatus = MSG.Status
MsgBox(MSG.Status)
' MsgBox(MSG.Status)
'Status in DB Ubdaten
Me.sms_Status = messageStatus
Me.sms_Sent = MSG.SentAt
Me.sms_Delivered = MSG.DeliveredAt
If IsDate(MSG.DeliveredAt) Then
Me.sms_Status = 3 ': MsgBox("SENT")
Else
'MsgBox("NOT SENT")
End If
If MSG.FailureReason IsNot Nothing Then Me.sms_Failure = MSG.FailureReason.Description
Me.SAVE()
Return messageStatus
Catch ex As Exception
MsgBox("Fehler beim Prüfen des SMS Status!" & vbNewLine & ex.Message & ex.StackTrace)
If Not silent Then MsgBox("Fehler beim Prüfen des SMS Status!" & vbNewLine & ex.Message & ex.StackTrace)
End Try
Return ""
End Function
Shared Function SEND_StatusSMS(AVISOId As Integer) As Boolean
Dim AVISO = cAviso.getAvisoById(AVISOId, "")
Return SEND_StatusSMS(AVISO)
End Function
Shared Function SEND_StatusSMS(AVISO As cAviso) As Boolean
If If(AVISO.FahrerHandy, "") <> "" AndAlso IsNumeric(AVISO.FahrerHandy.trim) Then
Dim absenderAccount = ""
Dim absenderFirma = ""
VERAG_PROG_ALLGEMEIN.cSMS.GET_AccountInfo(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA, absenderAccount, absenderFirma)
' If vbYes = MsgBox("Soll die Nachricht gesendet werden?" & vbNewLine & "Handy-Nummer: " & nr, MsgBoxStyle.YesNo) Then
Dim SMS = New VERAG_PROG_ALLGEMEIN.cSMS
SMS.sms_Vorwahl = ""
SMS.sms_Handynummer = "00436644178557" 'AVISO.FahrerHandy.trim 'txtHandyNummer.Text.Replace(" ", "").Replace("-", "").Replace("/", "")
SMS.sms_Nachricht = "Statusmeldung: " & vbNewLine &
"https://login.verag.ag/status.aspx?AvisoId=" & VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(AVISO.AvisoID)
SMS.sms_Account = absenderAccount
SMS.sms_Firma = absenderFirma
SMS.sms_KundenNr = If(AVISO.Frächter_KdNr > 0, AVISO.Frächter_KdNr, Nothing)
SMS.sms_Kunde = If(AVISO.Frächter <> "", AVISO.Frächter, Nothing)
SMS.sms_Fahrername = Nothing 'If(AVISO.fahrern <> "", FahrerName, Nothing)
SMS.sms_AvisoId = AVISO.AvisoID
If SMS.sendSMS Then
Return True
End If
End If
Return False
End Function
Shared Sub GET_AccountInfo(Firma, ByRef absenderAccount, ByRef absenderFirma)
Select Case Firma'cboFirma._value
Case "VERAG" ', "BEIDE"
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_abteilung
Case "ZOLL", "QS" : absenderAccount = "EX0252513" : absenderFirma = "VERAG Spedition"
Case "MDM" : absenderAccount = "EX0252747" : absenderFirma = "VERAG 360"
Case Else : absenderAccount = "EX0252513" : absenderFirma = "VERAG Spedition"
'Case Else : MsgBox("Fehler bei der Datenprüfung: Abteilung.") : Exit Sub
End Select
Case "ATILLA" : absenderAccount = "EX0252746" : absenderFirma = "ATILLA Spedition"
Case "IMEX" : absenderAccount = "EX0272082" : absenderFirma = "IMEX Spedition"
Case "UNISPED" : absenderAccount = "EX0300174" : absenderFirma = "UNISPED Spedition"
Case "FRONTOFFICE" : absenderAccount = "EX0300173" : absenderFirma = "FRONT-OFFICE SUBEN"
Case "AMBAR" : absenderAccount = "EX0315223" : absenderFirma = "AMBAR"
Case Else : MsgBox("Fehler bei der Datenprüfung: Firmendaten.") : Exit Sub
End Select
End Sub
End Class