Imports GrapeCity.ActiveReports 
Imports GrapeCity.ActiveReports.Document 

Public Class rptSDLBenachrichtigungids
    Public sdlNr As Integer = -1
    Public sdlText As String = ""
    Public KdNr As Integer = -1
    Public fahrer As Boolean = False
    Public KUNDE As cKundenFMZOLL
    Public cSqlDb As New cSqlDb
    Public von As Date
    Public bis As Date
    Public sachbearbeiter As String
    Public Sprache As String = "DE"
    Public ds = Nothing
    Private Sub rptAuswertung_ReportStart(sender As System.Object, e As System.EventArgs) Handles MyBase.ReportStart
        If KdNr <= 0 Then MsgBox("Keine Kunden-Nr angegeben!") : Exit Sub
        ' If sdlNr <= 0 Then Exit Sub
        Dim kundenSQL As New kundenSQL
        Me.DataSource = ds


        KUNDE = kundenSQL.getKundeFMZOLLByKdNr(KdNr)

        lblFirma.Text = KUNDE.Name_1 & vbNewLine &
                        IIf(KUNDE.Name_2 <> "", KUNDE.Name_2 & vbNewLine, "") &
                        KUNDE.Straße & vbNewLine & vbNewLine &
                        KUNDE.LandKz & " " & KUNDE.PLZ & " " & KUNDE.Ort

        lblAnspr.Text = KUNDE.Ansprechpartner

        lblUnterschrift.Text = "i.A. " & sachbearbeiter
        Label12.Text = sachbearbeiter

        If KUNDE.Telefax <> "" Then : lblFAX.Text = "FAX-Nr.: " & KUNDE.Telefax
        ElseIf KUNDE.E_Mail <> "" Then : lblFAX.Text = "E-Mail: " & KUNDE.E_Mail
        End If

        Dim gueltig = InputBox("Bitte geben Sie das gültigkeitsdatum an:", "Gültig bis", "")

        Select Case Sprache
            Case "DE"
            Case "TR"
                If False Then
                    Label8.Text = "Sayin Yetkili," & vbNewLine & vbNewLine & "Soförleriniz Cek Otomatik Cihazini alabilmesi icin, asagida belirtmis oldugum Kodu ile " & vbNewLine & "Müracaat ederek, yeni Cihazini almasi ve Otomatik Maut icin dahil olmasi gerekmektedir!"
                    Label13.Text = ""
                    lblBetreff.Text = "Konu: CEK Premid-Box cihazi icin Barkod"
                    Label1.Text = Label1.Text.Replace("2777 - 0", "2777 - 56")
                    Label1.Text = Label1.Text.Replace("yu@verag.ag", "maut.tr@verag.ag")
                    Label1.Text = Label1.Text.Replace("3386", "33155")
                    Label14.Text = "PLAKA"
                    lblMfg.Text = "Mit freundlichen Grüßen / Saygilarimla"
                End If
            Case "YU"
                Label8.Text = Label8.Text & gueltig
                '
                ' Label13.Text = "Vozac moze da preuzme POST-PAY-kutiju kod svakog PREMID-distributora!"
                ' lblBetreff.Text = "Betr.: REGISTRACIJA CZ-PUTARINE"
                Label1.Text = Label1.Text.Replace("2777 - 0", "2777 - 16")
                Label1.Text = Label1.Text.Replace("yu@verag.ag", "z.batinic@verag.ag")
                Label1.Text = Label1.Text.Replace("3386", "33155")
                ' Label14.Text = "PLATE NUMBER"
                ' lblMfg.Text = "Srdacan pozdrav"
            Case "RO"
                Label8.Text = "Stimate doamne, stimati domni," & vbNewLine & vbNewLine & "Cartele de combustibil IDS noi (  prevazute cu un cip ) , se pot ridica la centrala firmei VERAG din Suben." & vbNewLine & "Dupa ce s au distribuit soferilor dvs , va rugam cele vechi sa le distrugeti. " &
                    vbNewLine & vbNewLine & " Pentru ca sant valabile doar pana la data de:  " & gueltig

                Label11.Text = "VA RUGAM SA REDIRECTIONATI CODURILE PIN SOFERILOR DVS."
                Label13.Text = "Soferii dvs pot ridica aceste carduri  in timpul programului de lucru din Suben." &
                                  "Program de lucru:" & vbTab & "LU-VI	 intre orele  6 - 22" &
                                  vbNewLine & vbTab & vbTab & "SA	 intre orele   6- 13"
                lblBetreff.Text = "REF: CARDURI  COMBUSTIBIL -  IDS !!!!"
                Label1.Text = Label1.Text.Replace("2777 - 0", "2777 - 41")
                Label1.Text = Label1.Text.Replace("yu@verag.ag", "ma@verag.ag")
                Label14.Text = "NUMERU DE CAMION"
                lblMfg.Text = "Cu salutari cordiale"
        End Select
    End Sub

    Dim dummycount As Integer = 0
    Private Sub Detail1_Format(sender As System.Object, e As System.EventArgs) Handles Detail.Format
        dummycount += 1

        lblKennzeichen.Text = cSqlDb.checkNullStr(Fields.Item("KfzKennzeichen").Value)
        lblMSENr.Text = cSqlDb.checkNullStr(Fields.Item("PIN").Value)

        'Abwechselnd grauen und weißen Hintergrund
        If (dummycount Mod 2) = 0 Then
            Shape.BackColor = System.Drawing.Color.White
        Else
            Shape.BackColor = System.Drawing.Color.WhiteSmoke
        End If
    End Sub



End Class
