372 lines
16 KiB
VB.net
372 lines
16 KiB
VB.net
|
|
Imports System.Data
|
|
Imports System.Web.UI.HtmlControls
|
|
|
|
Partial Class Kundenbereich_Default
|
|
Inherits System.Web.UI.Page
|
|
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
|
tbl_Header_row.TableSection = TableRowSection.TableHeader
|
|
|
|
DataBind()
|
|
If (Page.IsPostBack And normaltable.EnableViewState = False) Then
|
|
normaltable.EnableViewState = True
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub LogOutBtn1_Click(sender As Object, e As EventArgs)
|
|
Response.Redirect("../login/Logout.aspx", True)
|
|
End Sub
|
|
Protected Sub LogOutBtn2_Click(sender As Object, e As EventArgs)
|
|
Response.Redirect("../login/Logout.aspx", True)
|
|
End Sub
|
|
|
|
Dim datevon As DateTime
|
|
Dim datebis As DateTime
|
|
Dim Kdnrtext As String
|
|
Dim Absender As String = ""
|
|
Dim Empfaenger As String = ""
|
|
Dim LKWNR As String = ""
|
|
Dim KDNAFNR As String = ""
|
|
Dim dt As DataTable
|
|
|
|
Enum ART
|
|
Kunde
|
|
AVISIERER
|
|
Frächter
|
|
VERAG
|
|
ZOLL
|
|
End Enum
|
|
|
|
Protected Sub initcells(tr As TableRow, t1 As TableCell, t2 As TableCell, t3 As TableCell, t4 As TableCell, t5 As TableCell, t6 As TableCell, t7 As TableCell, t8 As TableCell, th1 As TableHeaderCell, th2 As TableHeaderCell, th3 As TableHeaderCell, th4 As TableHeaderCell, th5 As TableHeaderCell, th6 As TableHeaderCell, th7 As TableHeaderCell, th8 As TableHeaderCell)
|
|
Dim blau As Drawing.Color = Drawing.Color.LightBlue
|
|
Dim white As Drawing.Color = Drawing.Color.White
|
|
Dim schwarz As Drawing.Color = Drawing.Color.Black
|
|
|
|
Dim darkgrau As Drawing.Color = Drawing.Color.DarkGray
|
|
Dim darkblue = Drawing.Color.FromArgb(4, 51, 129)
|
|
tr.BackColor = blau
|
|
If t1.Text = "" Then
|
|
t1.BackColor = blau
|
|
t1.ForeColor = schwarz
|
|
Else
|
|
t1.BackColor = blau
|
|
t1.ForeColor = schwarz
|
|
End If
|
|
If t2.Text = "Erfasst" Then
|
|
t2.BackColor = Drawing.Color.LightPink
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Nicht eingetroffen" Then
|
|
t2.BackColor = Drawing.Color.Black
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Ankunft" Then
|
|
t2.BackColor = Drawing.Color.DarkBlue
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Vorbereitet" Then
|
|
t2.BackColor = System.Drawing.Color.Brown
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Vorgeschrieben" Then
|
|
t2.BackColor = Drawing.Color.Purple
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Freigabe" Then
|
|
t2.BackColor = Drawing.Color.DarkOliveGreen
|
|
t2.ForeColor = white
|
|
ElseIf t2.Text = "Undefiniert" Then
|
|
t2.BackColor = Drawing.Color.DarkGray
|
|
t2.ForeColor = white
|
|
Else
|
|
t2.BackColor = blau
|
|
t2.ForeColor = schwarz
|
|
End If
|
|
If t3.Text = "" Then
|
|
t3.BackColor = blau
|
|
t3.ForeColor = schwarz
|
|
Else
|
|
t3.BackColor = blau
|
|
t3.ForeColor = schwarz
|
|
End If
|
|
If t4.Text = "" Then
|
|
t4.BackColor = blau
|
|
t4.ForeColor = schwarz
|
|
Else
|
|
t4.BackColor = blau
|
|
t4.ForeColor = schwarz
|
|
End If
|
|
If t5.Text = "" Then
|
|
t5.BackColor = blau
|
|
t5.ForeColor = schwarz
|
|
Else
|
|
t5.BackColor = blau
|
|
t5.ForeColor = schwarz
|
|
End If
|
|
If t6.Text = "" Then
|
|
t6.BackColor = blau
|
|
t6.ForeColor = schwarz
|
|
Else
|
|
t6.BackColor = blau
|
|
t6.ForeColor = schwarz
|
|
End If
|
|
If t7.Text = "" Then
|
|
t7.BackColor = blau
|
|
t7.ForeColor = schwarz
|
|
Else
|
|
t7.BackColor = blau
|
|
t7.ForeColor = schwarz
|
|
End If
|
|
If t8.Text = "" Then
|
|
t8.BackColor = blau
|
|
t8.ForeColor = schwarz
|
|
Else
|
|
t8.BackColor = blau
|
|
t8.ForeColor = schwarz
|
|
End If
|
|
th1.Font.Bold = True
|
|
th1.BackColor = darkblue
|
|
th1.ForeColor = white
|
|
th2.Font.Bold = True
|
|
th2.BackColor = darkblue
|
|
th2.ForeColor = white
|
|
th3.Font.Bold = True
|
|
th3.BackColor = darkblue
|
|
th3.ForeColor = white
|
|
th4.Font.Bold = True
|
|
th4.BackColor = darkblue
|
|
th4.ForeColor = white
|
|
th5.Font.Bold = True
|
|
th5.BackColor = darkblue
|
|
th5.ForeColor = white
|
|
th6.Font.Bold = True
|
|
th6.BackColor = darkblue
|
|
th6.ForeColor = white
|
|
th7.Font.Bold = True
|
|
th7.BackColor = darkblue
|
|
th7.ForeColor = white
|
|
th8.Font.Bold = True
|
|
th8.BackColor = darkblue
|
|
th8.ForeColor = white
|
|
|
|
End Sub
|
|
Protected Sub btn_Auftraege_Click(sender As Object, e As EventArgs)
|
|
'MsgBox(Session.Item("test").ToString)
|
|
'MsgBox(Session.Item("CustomerID").ToString)
|
|
'MsgBox(Session.Item("PW").ToString)
|
|
Kdnrtext = Session.Item("CustomerID").ToString
|
|
|
|
dt = Nothing
|
|
If txt_Absender.Text IsNot "" Or txt_Absender_M.Text IsNot "" Then
|
|
txt_Absender.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Absender = txt_Absender.Text
|
|
txt_Absender_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Absender = txt_Absender_M.Text
|
|
ElseIf txt_Empfaenger.Text IsNot "" Or txt_Empfaenger_M.Text IsNot "" Then
|
|
txt_Empfaenger.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Empfaenger = txt_Empfaenger.Text
|
|
txt_Empfaenger_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Empfaenger = txt_Empfaenger_M.Text
|
|
ElseIf txt_KdNrAuftrag.Text IsNot "" Or txt_KdNrAuftrag_M.Text IsNot "" Then
|
|
txt_KdNrAuftrag.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
KDNAFNR = txt_KdNrAuftrag.Text
|
|
txt_KdNrAuftrag_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
KDNAFNR = txt_KdNrAuftrag_M.Text
|
|
ElseIf txt_LKWNr.Text IsNot "" Or txt_LKWNr_M.Text IsNot "" Then
|
|
txt_LKWNr.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
LKWNR = txt_LKWNr.Text
|
|
txt_LKWNr_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
LKWNR = txt_LKWNr_M.Text
|
|
End If
|
|
|
|
'Dim tr
|
|
If rbt_Alle.Selected = True Or rbt_Alle_M.Selected = True Then
|
|
If Date.Parse(pickdate2.Text) > Date.Parse(pickdate1.Text) Then
|
|
Try
|
|
datevon = Date.Parse(pickdate1.Text)
|
|
datebis = Date.Parse(pickdate2.Text)
|
|
Catch ex As Exception
|
|
MsgBox(ex.StackTrace, MsgBoxStyle.Exclamation)
|
|
End Try
|
|
End If
|
|
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {0, 1, 2, 3, 4, 5}, datevon, datebis, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
|
|
ElseIf rbt_Erf.Selected = True Or rbt_Erf_M.Selected Then
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {0},,, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
ElseIf rbt_Freig.Selected = True Or rbt_Freig_M.Selected = True Then
|
|
|
|
If Date.Parse(pickdate2.Text) > Date.Parse(pickdate1.Text) Then
|
|
Try
|
|
pickdate1.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
datevon = Date.Parse(pickdate1.Text)
|
|
pickdate2.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
datebis = Date.Parse(pickdate2.Text)
|
|
Catch ex As Exception
|
|
MsgBox(ex.StackTrace, MsgBoxStyle.Exclamation)
|
|
End Try
|
|
ElseIf pickdate1.Text = "TT.MM.JJJJ" And pickdate2.Text = "TT.MM.JJJJ" Then
|
|
MsgBox("Bitte ein Datum auswählen!", MsgBoxStyle.Information, "Information!")
|
|
Else
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {1}, Date.ParseExact("01-MM-yyyy", "dd-MM-yyyy", Nothing), Date.Now)
|
|
End If
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {1}, datevon, datebis, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
ElseIf rbt_Ankunft.Selected = True Or rbt_Ankunft_M.Selected = True Then
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {3},,, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
ElseIf rbt_Vorb.Selected = True Or rbt_Vorb_M.Selected = True Then
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {4},,, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
ElseIf rbt_Vorg.Selected = True Or rbt_Vorg_M.Selected = True Then
|
|
dt = VERAG_PROG_ALLGEMEIN.cAviso.GET_KDLIST_WEB("", Kdnrtext, {5},,, Absender, Empfaenger, LKWNR, KDNAFNR)
|
|
End If
|
|
|
|
If dt IsNot Nothing Then
|
|
Dim i As Integer = 0
|
|
'Dim sb As StringBuilder = New StringBuilder()
|
|
|
|
'Table start.
|
|
'sb.Append("<table cellpadding='5' cellspacing='0' style='border: 1px solid #ccc;font-size: 9pt;font-family:Arial'>")
|
|
'Adding HeaderRow.
|
|
'sb.Append("<tr>")
|
|
'For Each column As DataColumn In dt.Columns
|
|
' sb.Append(("<th style='background-color: #B8DBFD;border: 1px solid #ccc'>" _
|
|
' + (column.ColumnName + "</th>")))
|
|
'Next
|
|
'sb.Append("</tr>")
|
|
'Adding DataRow.
|
|
'For Each row As DataRow In dt.Rows
|
|
'sb.Append("<tr>")
|
|
'For Each column As DataColumn In dt.Columns
|
|
' sb.Append(("<td style='width:100px;border: 1px solid #ccc'>" _
|
|
' + (row(column.ColumnName).ToString + "</td>")))
|
|
' Next
|
|
' sb.Append("</tr>")
|
|
'Next
|
|
'Table end.
|
|
'sb.Append("</table>")
|
|
' ltTable.Text = sb.ToString
|
|
|
|
For Each d In dt.Rows
|
|
Dim Cell = New TableCell
|
|
Dim tbl_CellIndex = New TableCell
|
|
Dim tbl_CellStatus = New TableCell
|
|
Dim tbl_Cell_Auftragsdatum = New TableCell
|
|
Dim tbl_CellAbsender = New TableCell
|
|
Dim tbl_CellEmpfaenger = New TableCell
|
|
Dim tbl_CellLKWs = New TableCell
|
|
Dim tbl_CellKundAuftNr = New TableCell
|
|
Dim tbl_CellInfo = New TableCell
|
|
Dim tr = New TableRow
|
|
|
|
'tr = New HtmlTableRow()
|
|
|
|
Dim zahl = i + 1
|
|
tbl_CellIndex.Text = zahl
|
|
tr.Cells.Add(tbl_CellIndex)
|
|
tbl_CellLKWs.Text = d("LKW_Nr").ToString
|
|
tr.Cells.Add(tbl_CellLKWs)
|
|
|
|
Select Case d("Status")
|
|
Case 1
|
|
tbl_CellStatus.Text = "Erfasst"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
Case 1
|
|
tbl_CellStatus.Text = "Freigabe"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
Case 2
|
|
tbl_CellStatus.Text = "Nicht eingetroffen"
|
|
tr.Cells.Add(Cell)
|
|
Case 3
|
|
tbl_CellStatus.Text = "Ankunft"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
Case 4
|
|
tbl_CellStatus.Text = "Vorbereitet"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
Case 5
|
|
tbl_CellStatus.Text = "Vorgeschrieben"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
Case Nothing
|
|
tbl_CellStatus.Text = "Undefiniert"
|
|
tr.Cells.Add(tbl_CellStatus)
|
|
End Select
|
|
initcells(tr, tbl_CellIndex, tbl_CellStatus, tbl_Cell_Auftragsdatum, tbl_CellAbsender, tbl_CellEmpfaenger, tbl_CellLKWs, tbl_CellKundAuftNr, tbl_CellInfo, tbl_HeaderCellIndexNr, tbl_HeaderCell_Status, tbl_HeaderCell_Auftragsdatum, tbl_HeaderCell_Absender, tbl_HeaderCell_Empfaenger, tbl_HeaderCell_LKWs, tbl_HeaderCell_KundAuftNr, tbl_HeaderCell_Info)
|
|
tbl_Cell_Auftragsdatum.Text = d("AvisoEingang").ToString
|
|
tr.Cells.Add(tbl_Cell_Auftragsdatum)
|
|
tbl_CellAbsender.Text = d("Auftraggeber").ToString
|
|
tr.Cells.Add(tbl_CellAbsender)
|
|
tbl_CellEmpfaenger.Text = d("Auftraggeber").ToString
|
|
tr.Cells.Add(tbl_CellEmpfaenger)
|
|
tbl_CellKundAuftNr.Text = d("KdAuftragsNr_Avisierer").ToString
|
|
tr.Cells.Add(tbl_CellKundAuftNr)
|
|
|
|
Dim btn As New LinkButton
|
|
btn.ViewStateMode = ViewStateMode.Disabled
|
|
'btn.Text = "Text"
|
|
btn.CssClass = "btn btn-primary"
|
|
btn.Attributes.Add("Text", <img src="../images/Icons/service/hilfe_small.png" width="15" height="15"/>)
|
|
btn.Attributes.Add("href", "../status_Julius.aspx?AvisoId=" + VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(d("AvisoID")).ToString)
|
|
btn.Attributes.Add("target", "_blank")
|
|
btn.PostBackUrl = "../status_Julius.aspx?AvisoId=" + VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(d("AvisoID")).ToString
|
|
|
|
tbl_CellInfo.Controls.Add(btn)
|
|
tbl_CellInfo.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
tr.Cells.Add(tbl_CellInfo)
|
|
|
|
If (rbt_Alle.Selected = True Or rbt_Alle_M.Selected = True) Then
|
|
normaltable.Rows.Add(tr)
|
|
ElseIf (rbt_Ankunft.Selected = True Or rbt_Ankunft_M.Selected = True) AndAlso tbl_CellStatus.Text = "Ankunft" Then
|
|
normaltable.Rows.Add(tr)
|
|
ElseIf (rbt_Erf.Selected = True Or rbt_Erf_M.Selected = True) AndAlso tbl_CellStatus.Text = "Erfasst" Then
|
|
normaltable.Rows.Add(tr)
|
|
ElseIf (rbt_Freig.Selected = True Or rbt_Freig_M.Selected = True) AndAlso tbl_CellStatus.Text = "Freigegeben" Then
|
|
normaltable.Rows.Add(tr)
|
|
ElseIf (rbt_Vorb.Selected = True Or rbt_Vorb_M.Selected = True) AndAlso tbl_CellStatus.Text = "Vorbereitet" Then
|
|
normaltable.Rows.Add(tr)
|
|
ElseIf (rbt_Vorg.Selected = True Or rbt_Vorg_M.Selected = True) AndAlso tbl_CellStatus.Text = "Vorgeschrieben" Then
|
|
normaltable.Rows.Add(tr)
|
|
End If
|
|
|
|
i += 1
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub btn_resetForm_Click(sender As Object, e As EventArgs)
|
|
'Mobil
|
|
rbt_Alle_M.Selected = False
|
|
rbt_Alle_M.Enabled = True
|
|
rbt_Ankunft_M.Selected = False
|
|
rbt_Ankunft_M.Enabled = True
|
|
rbt_Erf_M.Selected = False
|
|
rbt_Erf_M.Enabled = True
|
|
rbt_Freig_M.Selected = False
|
|
rbt_Freig_M.Enabled = True
|
|
rbt_Vorg_M.Selected = False
|
|
rbt_Vorg_M.Enabled = True
|
|
rbt_Vorb_M.Selected = False
|
|
rbt_Vorb_M.Enabled = True
|
|
txt_Absender_M.Text = ""
|
|
txt_Empfaenger_M.Text = ""
|
|
txt_KdNrAuftrag_M.Text = ""
|
|
txt_LKWNr_M.Text = ""
|
|
'Desktop
|
|
rbt_Alle.Selected = False
|
|
rbt_Alle.Enabled = True
|
|
rbt_Ankunft.Selected = False
|
|
rbt_Ankunft.Enabled = True
|
|
rbt_Erf.Selected = False
|
|
rbt_Erf.Enabled = True
|
|
rbt_Freig.Selected = False
|
|
rbt_Freig.Enabled = True
|
|
rbt_Vorg.Selected = False
|
|
rbt_Vorg.Enabled = True
|
|
rbt_Vorb.Selected = False
|
|
rbt_Vorb.Enabled = True
|
|
txt_Absender.Text = ""
|
|
txt_Empfaenger.Text = ""
|
|
txt_KdNrAuftrag.Text = ""
|
|
txt_LKWNr.Text = ""
|
|
|
|
pickdate1.Text = ""
|
|
pickdate2.Text = ""
|
|
datevon = Nothing
|
|
datebis = Nothing
|
|
dt = Nothing
|
|
'txt_KdNr.Focus()
|
|
End Sub
|
|
End Class |