Imports GrapeCity.ActiveReports 
Imports GrapeCity.ActiveReports.Document

Public Class rptSDLBenachrichtigungPL
    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


        Select Case Sprache
            Case "DE"

            Case "TR"
                Label8.Text = "Sayin Yetkili," & vbNewLine & vbNewLine & "YeniSoförleriniz PL 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: PL VIA-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 = "PLATE NUMBER"
                '  Label15.Text = "KART/CIHAZ"
                lblMfg.Text = "Mit freundlichen Grüßen / Saygilarimla"

            Case "YU"
                Label8.Text = "Postovane dame i gospodo," & vbNewLine & vbNewLine & "sljedeci kamioni su registrirani za poljsku putarinu (VIATOLL):"
                Label13.Text = "Vozac moze da preuzme POST-PAY-kutiju kod svakog VIATOLL-distributora! Molim da svakom vozacu prosljedite navedeni 'Account-Card-Number'."
                lblBetreff.Text = "Betr.: REGISTRACIJA PL-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"
                '  Label15.Text = "KARTICE/BOKSOVE"
                lblMfg.Text = "Srdacan pozdrav"

            Case "RO"
                If False Then
                    Label8.Text = "Stimate client!" & vbNewLine & vbNewLine & "Va rugäm sä ridicati cartelele comandate de la sediul nostru:"

                    Label13.Text = "Va rugam sa redirectionati codurile pin soferilor dvs."
                    lblBetreff.Text = "REF: INFORMARE"
                    Label1.Text = Label1.Text.Replace("2777 - 0", "2777 - 41")
                    Label1.Text = Label1.Text.Replace("yu@verag.ag", "ma@verag.ag")
                    Label14.Text = "PLATE NUMBER"
                    ' Label15.Text = "CARTELA/BOX"
                    lblMfg.Text = "Multumim pentru colaborare cu Respect"
                End If
        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)
        lblKarteBox.Text = cSqlDb.checkNullStr(Fields.Item("MSE-Kd-Nr").Value)




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



End Class
