Änderungen Seite Invoices aspx Logik

This commit is contained in:
ja
2021-10-27 17:00:26 +02:00
parent 7efd4f7dc5
commit 9185a95331
3 changed files with 288 additions and 9 deletions

View File

@@ -105,6 +105,7 @@ Partial Class CustomsAviso
Else
regexval_txt_Absender.Enabled = True
End If
'Mobile
If String.IsNullOrEmpty(txt_LKWNr_M.Text) Then
regexval_txt_LKWNr_M.Enabled = False
Else
@@ -128,13 +129,6 @@ Partial Class CustomsAviso
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
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

View File

@@ -137,7 +137,7 @@
<asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger" runat="server" ID="regexval_txt_Empfaenger" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Empfänger: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
</div>
<div id="rowcol3" class="col-12">
<asp:Label ID="txt_Rechnungnr" runat="server" Text="Rechnungs-Nummer:"></asp:Label>
<asp:Label ID="lbl_ReNr" runat="server" Text="Rechnungs-Nummer:"></asp:Label>
<asp:TextBox ID="txt_ReNr" runat="server" style="width:155px;margin-left:8px" OnTextChanged="txt_ReNr_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator ControlToValidate="txt_ReNr" runat="server" ID="regexval_txt_ReNr" ValidationGroup="additional_TXTs" ValidationExpression="^([1-9]{8})$" Display="Dynamic" ErrorMessage="Rechnungsnummer: Falsches Format" SetFocusOnError="true"></asp:RegularExpressionValidator>
</div>
@@ -162,7 +162,7 @@
<asp:RegularExpressionValidator ControlToValidate="txt_Absender_M" runat="server" ID="regexval_txt_Absender_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Absender: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:Label ID="lbl_Empfaenger_M" runat="server" Text="Empfaenger"></asp:Label>
<asp:TextBox id="txt_Empfaenger_M" runat="server" style="width:117px;margin-left:25px" OnTextChanged="txt_Empfaenger_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger_M" runat="server" ID="regexval_txt_txt_Empfaenger_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Empfänger: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger_M" runat="server" ID="regexval_txt_Empfaenger_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Empfänger: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
</div>
<div id="rowcol6" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
<asp:Label ID="lbl_ReNr_M" runat="server" Text="Rechnungs-Nummer:"></asp:Label>

View File

@@ -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