386 lines
14 KiB
VB.net
386 lines
14 KiB
VB.net
|
|
Imports System.Data
|
|
|
|
Partial Class Customers_Invoices
|
|
Inherits System.Web.UI.Page
|
|
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
|
|
Dim reNr As String = ""
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
|
Page.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms
|
|
DataBind()
|
|
tbl_Header_row.TableSection = TableRowSection.TableHeader
|
|
|
|
If (Page.IsPostBack And normaltable.EnableViewState = False) Then
|
|
normaltable.EnableViewState = True
|
|
datevon = Date.Parse(pickdate1.Text)
|
|
datebis = Date.Parse(pickdate2.Text)
|
|
Else
|
|
normaltable.EnableViewState = True
|
|
lbl_von.Visible = True
|
|
lbl_bis.Visible = True
|
|
valDateRange_1.Enabled = True
|
|
valDateRange_2.Enabled = True
|
|
Dim erster = New Date(Now().Year, Now().Month, 1)
|
|
Dim ersterdat = erster.Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString
|
|
pickdate1.Text = erster.Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString
|
|
' MsgBox(ersterdat)
|
|
datevon = ersterdat
|
|
datebis = Date.Parse(Now().Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString).ToString
|
|
pickdate2.Text = Now().ToShortDateString()
|
|
pickdate1.Text = erster.Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString
|
|
If String.IsNullOrEmpty(txt_Absender.Text) Then
|
|
regexval_txt_Absender.Enabled = False
|
|
Else
|
|
regexval_txt_Absender.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_Empfaenger.Text) Then
|
|
regexval_txt_Empfaenger.Enabled = False
|
|
Else
|
|
regexval_txt_Empfaenger.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_KdNrAuftrag.Text) Then
|
|
regexval_txt_KdNrAuftrag.Enabled = False
|
|
Else
|
|
regexval_txt_KdNrAuftrag.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_LKWNr.Text) Then
|
|
regexval_txt_LKW.Enabled = False
|
|
Else
|
|
regexval_txt_LKW.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_ReNr.Text) Then
|
|
regexval_txt_ReNr.Enabled = False
|
|
Else
|
|
regexval_txt_ReNr.Enabled = False
|
|
End If
|
|
'Mobile
|
|
If String.IsNullOrEmpty(txt_Absender_M.Text) Then
|
|
regexval_txt_Absender_M.Enabled = False
|
|
Else
|
|
regexval_txt_Absender_M.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_Empfaenger_M.Text) Then
|
|
regexval_txt_Empfaenger_M.Enabled = False
|
|
Else
|
|
regexval_txt_Empfaenger_M.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_KdNrAuftrag_M.Text) Then
|
|
regexval_txt_KdNrAuftrag_M.Enabled = False
|
|
Else
|
|
regexval_txt_KdNrAuftrag_M.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_LKWNr_M.Text) Then
|
|
regexval_txt_LKW_M.Enabled = False
|
|
Else
|
|
regexval_txt_LKW_M.Enabled = True
|
|
End If
|
|
If String.IsNullOrEmpty(txt_ReNr_M.Text) Then
|
|
regexval_txt_ReNr_M.Enabled = False
|
|
Else
|
|
regexval_txt_ReNr_M.Enabled = True
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
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 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 = white
|
|
If t1.Text = "" Then
|
|
t1.BackColor = white
|
|
t1.ForeColor = schwarz
|
|
Else
|
|
t1.BackColor = white
|
|
t1.ForeColor = schwarz
|
|
End If
|
|
If t2.Text = "" Then
|
|
t2.BackColor = Drawing.Color.HotPink
|
|
t2.ForeColor = white
|
|
Else
|
|
t2.BackColor = Drawing.Color.Red
|
|
t2.ForeColor = white
|
|
End If
|
|
If t3.Text = "" Then
|
|
t3.BackColor = white
|
|
t3.ForeColor = schwarz
|
|
Else
|
|
t3.BackColor = white
|
|
t3.ForeColor = schwarz
|
|
End If
|
|
If t4.Text = "" Then
|
|
t4.BackColor = white
|
|
t4.ForeColor = schwarz
|
|
Else
|
|
t4.BackColor = white
|
|
t4.ForeColor = schwarz
|
|
End If
|
|
If t5.Text = "" Then
|
|
t5.BackColor = white
|
|
t5.ForeColor = schwarz
|
|
Else
|
|
t5.BackColor = white
|
|
t5.ForeColor = schwarz
|
|
End If
|
|
If t6.Text = "" Then
|
|
t6.BackColor = white
|
|
t6.ForeColor = schwarz
|
|
Else
|
|
t6.BackColor = white
|
|
t6.ForeColor = schwarz
|
|
End If
|
|
If t7.Text = "" Then
|
|
t7.BackColor = white
|
|
t7.ForeColor = schwarz
|
|
Else
|
|
t7.BackColor = white
|
|
t7.ForeColor = schwarz
|
|
End If
|
|
If t8.Text = "" Then
|
|
t8.BackColor = white
|
|
t8.ForeColor = schwarz
|
|
Else
|
|
t8.BackColor = white
|
|
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_resetForm_Click(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub pickdate1_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub valDateRange_1_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub pickdate2_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub valDateRange_2_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_LKWNr_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_Empfaenger_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_Absender_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_ReNr_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_KdNrAuftrag_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_LKWNr_M_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub TextBox2_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub txt_KdNrAuftrag_M_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
|
|
Protected Sub btn_Rechnungen_Click(sender As Object, e As EventArgs)
|
|
Try
|
|
Kdnrtext = Session.Item("CustomerID")
|
|
Catch A As UnauthorizedAccessException When Kdnrtext = Nothing
|
|
MsgBox("Dieser Bereich ist nicht gestattet! Ein Fehler ist bei der Validierung der ID aufgetreten! Bitte erneut versuchen!", MsgBoxStyle.Information, "Error in User Area!")
|
|
End Try
|
|
dt = Nothing
|
|
reqfield_txt_kundenNr.Validate()
|
|
valreq_pickdate1.Validate()
|
|
valreq_pickdate2.Validate()
|
|
If reqfield_txt_kundenNr.IsValid AndAlso valreq_pickdate1.IsValid AndAlso valreq_pickdate2.IsValid Then
|
|
If txt_Absender.Text IsNot "" Then
|
|
regexval_txt_Absender.Enabled = True
|
|
regexval_txt_Absender.Validate()
|
|
txt_Absender.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
If regexval_txt_Absender.IsValid = True Then
|
|
Absender = txt_Absender.Text
|
|
Else
|
|
Absender = String.Empty
|
|
End If
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_Empfaenger.Text IsNot "" Then
|
|
regexval_txt_Empfaenger.Enabled = True
|
|
regexval_txt_Empfaenger.Validate()
|
|
txt_Empfaenger.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
If regexval_txt_Empfaenger.IsValid = True Then
|
|
Empfaenger = txt_Empfaenger.Text
|
|
Else
|
|
Empfaenger = String.Empty
|
|
End If
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_KdNrAuftrag.Text IsNot "" Then
|
|
regexval_txt_KdNrAuftrag.Enabled = True
|
|
regexval_txt_KdNrAuftrag.Validate()
|
|
txt_KdNrAuftrag.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
If regexval_txt_KdNrAuftrag.IsValid = True Then
|
|
KDNAFNR = txt_KdNrAuftrag.Text
|
|
Else
|
|
KDNAFNR = String.Empty
|
|
End If
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_LKWNr.Text IsNot "" Then
|
|
regexval_txt_LKW.Enabled = True
|
|
regexval_txt_LKW.Validate()
|
|
txt_LKWNr.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
If regexval_txt_LKW.IsValid = True Then
|
|
LKWNR = txt_LKWNr.Text
|
|
Else
|
|
LKWNR = String.Empty
|
|
End If
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_ReNr.Text IsNot "" Then
|
|
regexval_txt_ReNr.Enabled = True
|
|
regexval_txt_ReNr.Validate()
|
|
txt_ReNr.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
If regexval_txt_ReNr.IsValid = True Then
|
|
reNr = txt_ReNr.Text
|
|
Else
|
|
reNr = String.Empty
|
|
End If
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
|
|
If txt_Absender_M.Text IsNot "" Then
|
|
txt_Absender_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
Absender = txt_Absender_M.Text
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_Empfaenger_M.Text IsNot "" Then
|
|
txt_Empfaenger_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
Empfaenger = txt_Empfaenger_M.Text
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_KdNrAuftrag_M.Text IsNot "" Then
|
|
txt_KdNrAuftrag_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
KDNAFNR = txt_KdNrAuftrag_M.Text
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_LKWNr_M.Text IsNot "" Then
|
|
txt_LKWNr_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
LKWNR = txt_LKWNr_M.Text
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
If txt_ReNr_M.Text IsNot "" Then
|
|
txt_ReNr_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
Try
|
|
reNr = txt_ReNr_M.Text
|
|
Catch ex As FormatException
|
|
|
|
End Try
|
|
End If
|
|
pickdate1.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
pickdate2.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
|
If pickdate1.Text = Nothing Or pickdate2.Text = Nothing Then
|
|
Try
|
|
Dim erster = New Date(Now().Year, Now().Month, 1)
|
|
Dim ersterdat = erster.Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString
|
|
' MsgBox(ersterdat)
|
|
datevon = ersterdat
|
|
pickdate1.Text = erster.Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString
|
|
datebis = Date.Parse(Now().Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString).ToString
|
|
pickdate2.Text = Date.Parse(Now().Day.ToString + "." + Now().Month.ToString + "." + Now().Year.ToString).ToString
|
|
Catch ex As ValidationException When Date.ParseExact(pickdate1.Text, "dd.MM.yyyy", Nothing).Year < Date.ParseExact("2001", "yyyy", Nothing).Year And Date.ParseExact(pickdate2.Text, "dd.MM.yyyy", Nothing).Year > Date.ParseExact(Today, "dd.MM.yyyy", Nothing).Year
|
|
MsgBox("Die Zeitzonen sind nicht gültig!", MsgBoxStyle.Exclamation)
|
|
End Try
|
|
Else
|
|
Try
|
|
datevon = Date.Parse(pickdate1.Text)
|
|
datebis = Date.Parse(pickdate2.Text)
|
|
Catch ex As ValidationException When Date.ParseExact(pickdate1.Text, "dd.MM.yyyy", Nothing).Year < Date.ParseExact("2001", "yyyy", Nothing).Year And Date.ParseExact(pickdate2.Text, "dd.MM.yyyy", Nothing).Year > Date.ParseExact(Today, "dd.MM.yyyy", Nothing).Year
|
|
MsgBox("Die Zeitzonen sind nicht gültig!", MsgBoxStyle.Exclamation)
|
|
End Try
|
|
End If
|
|
Else
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub txt_KundenNr_TextChanged(sender As Object, e As EventArgs)
|
|
|
|
End Sub
|
|
End Class
|