Änderungen

This commit is contained in:
ja
2022-01-13 11:05:30 +01:00
parent 82816a78c3
commit d750ae4a19
3 changed files with 1826 additions and 1876 deletions

View File

@@ -362,78 +362,43 @@
</script>
<script type="text/javascript">
$("<%=tablemain.ClientID%>").dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "LKWs.aspx/filltable2",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"type": "POST",
"dataType": 'json',
"contentType": "application/json; charset=utf-8",
"url": sSource,
"data": "{'sEcho': '" + aoData[0].value + "'}",
"success": function (msg) {
fnCallback(msg.d);
}
});
}
});
$("<%=tablemain_m.ClientID%>").dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "LKWs.aspx/filltable2_M",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"type": "POST",
"dataType": 'json',
"contentType": "application/json; charset=utf-8",
"url": sSource,
"data": "{'sEcho': '" + aoData[0].value + "'}",
"success": function (msg) {
fnCallback(msg.d);
}
});
}
});
function renderTable(result) {
let dtData = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result, function () {
dtData.push([
this.SDLNr,
this.Bez,
this.Gueltigbis,
this.Kartnr
]);
});
$('<%=tablemain.ClientID%>').dataTable({
'aaData': dtData,
"bJQueryUI": true
});
}
function renderTable_M(result_M) {
let dtData_M = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result_M, function () {
dtData_M.push([
this.SDLNr,
this.Bez,
this.Gueltigbis,
this.Kartnr
]);
});
$("<%=tablemain_m.ClientID%>").dataTable({
'aaData': dtData
});
}
function renderTable(result) {
let dtData = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result, function () {
dtData.push([
this._SDLNr,
this._Bez,
this._GueltigBis,
this._Kartnr
]);
});
$('<%=tablemain.ClientID%>').dataTable({
'aaData': dtData,
"bJQueryUI": true
});
}
function renderTable_M(result_M) {
let dtData_M = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result_M, function () {
dtData_M.push([
this._SDLNr,
this._Bez,
this._GueltigBis,
this._Kartnr
]);
});
$('<%=tablemain_m.ClientID%>').dataTable({
'aaData': dtData_M,
"bJQueryUI": true
});
}
function doPostBack(id) {
let Speditionslabel = document.getElementById('<%=lbl_sped_Placeholder.ClientID%>');
@@ -469,12 +434,11 @@
dataType: "json",
async: "false",
data: JSON.stringify(data),
success: function (response) {
let JSONObj = data.d;
success: function (result) {
alert('Horray! 200 status code!');
renderTable(JSONObj)
alert(result.d)
renderTable(result.d)
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
@@ -514,11 +478,11 @@
async: "false",
data: JSON.stringify(data),
success: function (data) {
result_M = data.d;
alert('Horray! 200 status code!');
renderTable_M(result_M);
alert(data.d)
renderTable_M(data.d);
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);

View File

@@ -412,6 +412,53 @@ Partial Class LKWS
Next
End Sub
<Serializable>
Public Class Entry
Private SDLNr As String
Private Bez As String
Private GueltigBis As String
Private Kartnr As String
Public Property _SDLNr() As String
Get
Return SDLNr
End Get
Set(ByVal value As String)
SDLNr = value
End Set
End Property
Public Property _Bez As String
Get
Return Bez
End Get
Set(ByVal value As String)
Bez = value
End Set
End Property
Public Property _GueltigBis As String
Get
Return GueltigBis
End Get
Set(ByVal value As String)
GueltigBis = value
End Set
End Property
Public Property _KartenNr As String
Get
Return Kartnr
End Get
Set(ByVal value As String)
Kartnr = value
End Set
End Property
Public Sub New(ByVal SDL As String, Bez As String, ByVal GueltigBis As String, ByVal KartNr As String)
Me._SDLNr = SDL
Me._Bez = Bez
Me._GueltigBis = GueltigBis
Me._KartenNr = KartNr
End Sub
End Class
<WebMethod(BufferResponse:=False, CacheDuration:=120, Description:="Funktion zum zurückgeben einer Tabelle", EnableSession:=False, TransactionOption:=EnterpriseServices.TransactionOption.NotSupported)>
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)>
Public Shared Function filltable2(Kennzeichen As String) As List(Of Entry)
@@ -419,34 +466,18 @@ Partial Class LKWS
Dim strtemp3 As String = strtemp2.Remove(0, 1)
MsgBox(Kdnrtext + vbCr + strtemp3)
Dim list As List(Of Entry) = New List(Of Entry)
Dim list2 As List(Of VERAG_PROG_ALLGEMEIN.cSDL) = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB_LKW(Integer.Parse(Kdnrtext), Kennzeichen)
If list2.Count > 0 Then
For Each l2 In list2
Dim Entrytemp As New Entry(l2.SDLNr.ToString, l2.Kategorie.ToString, l2.GültigBis.ToString, l2.KartenNr.ToString)
list.Add(Entrytemp)
Dim entr As Entry = New Entry(l2.SDLNr.ToString, l2.Kategorie.ToString, l2.GültigBis.ToString, l2.KartenNr.ToString)
list.Add(entr)
Next
ElseIf list2.Count = 0 Then
Dim Entrytemp As New Entry("Keine", "Daten", "gefunden", "!")
list.Add(Entrytemp)
Dim container As New Entry("Keine", "gültigen", "Daten", "gefunden!")
list.Add(container)
End If
Return list
End Function
<Serializable>
Public Class Entry
Public SDL As String = String.Empty
Public Bez As String = String.Empty
Public Gueltigbis As String = String.Empty
Public KartNr As String = String.Empty
Public Sub New(ByVal SDL As String, ByVal Bez As String, ByVal Gueltigbis As String, ByVal KartNr As String)
Me.SDL = SDL
Me.Bez = Bez
Me.Gueltigbis = Gueltigbis
Me.KartNr = KartNr
End Sub
End Class
<WebMethod(BufferResponse:=False, CacheDuration:=120, Description:="Funktion zum zurückgeben einer Tabelle", EnableSession:=False, TransactionOption:=EnterpriseServices.TransactionOption.NotSupported)>
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)>
@@ -455,17 +486,15 @@ Partial Class LKWS
Dim strtemp3 As String = strtemp2.Remove(0, 1)
MsgBox(Kdnrtext + vbCr + strtemp3)
Dim list As List(Of Entry) = New List(Of Entry)
Dim list2 As List(Of VERAG_PROG_ALLGEMEIN.cSDL) = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB_LKW(Integer.Parse(Kdnrtext), Kennzeichen)
If list2.Count > 0 Then
For Each l2 In list2
Dim Entrytemp As New Entry(l2.SDLNr.ToString, l2.Kategorie.ToString, l2.GültigBis.ToString, l2.KartenNr.ToString)
list.Add(Entrytemp)
Dim entr As Entry = New Entry(l2.SDLNr.ToString, l2.Kategorie.ToString, l2.GültigBis.ToString, l2.KartenNr.ToString)
list.Add(entr)
Next
ElseIf list2.Count = 0 Then
Dim Entrytempempty As New Entry("Keine", "Daten", "gefunden!", String.Empty)
list.Add(Entrytempempty)
Dim container As New Entry("Keine", "gültigen", "Daten", "gefunden!")
list.Add(container)
End If
Return list
End Function