Änderungen Seite Invoices aspx Logik
This commit is contained in:
@@ -1,6 +1,182 @@
|
||||
|
||||
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)
|
||||
@@ -56,6 +232,115 @@ Partial Class Customers_Invoices
|
||||
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
|
||||
If txt_Absender.Text IsNot "" Then
|
||||
txt_Absender.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
Try
|
||||
Absender = txt_Absender.Text
|
||||
Catch ex As FormatException
|
||||
|
||||
End Try
|
||||
End If
|
||||
If txt_Empfaenger.Text IsNot "" Then
|
||||
txt_Empfaenger.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
Try
|
||||
Empfaenger = txt_Empfaenger.Text
|
||||
Catch ex As FormatException
|
||||
|
||||
End Try
|
||||
End If
|
||||
If txt_KdNrAuftrag.Text IsNot "" Then
|
||||
txt_KdNrAuftrag.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
Try
|
||||
KDNAFNR = txt_KdNrAuftrag.Text
|
||||
Catch ex As FormatException
|
||||
|
||||
End Try
|
||||
End If
|
||||
If txt_LKWNr.Text IsNot "" Then
|
||||
txt_LKWNr.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
Try
|
||||
LKWNR = txt_LKWNr.Text
|
||||
Catch ex As FormatException
|
||||
|
||||
End Try
|
||||
End If
|
||||
If txt_ReNr.Text IsNot "" Then
|
||||
txt_ReNr.ValidateRequestMode = UI.ValidateRequestMode.Enabled
|
||||
Try
|
||||
reNr = txt_ReNr.Text
|
||||
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
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user