Umschreiben nach Vorschrift JSON Dokumentation
This commit is contained in:
@@ -333,9 +333,9 @@
|
||||
//addNewRow(SDL,Bez,Datguenstig,KartNr)
|
||||
// Pagemethods.filltable2(<%' =tbl_mainpage %> , SDL, Bez, Datguenstig, KartNr)
|
||||
//}
|
||||
var data = {
|
||||
"Kennzeichen": id.split(',')[0]
|
||||
};
|
||||
var data = {};
|
||||
data['Kennzeichen'] = id.split(',')[0];
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
@@ -343,23 +343,28 @@
|
||||
url: "LKWs.aspx/filltable2",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
async: true,
|
||||
data: JSON.stringify(data),
|
||||
success: function (result) {
|
||||
OnSuccess(result.d);
|
||||
success: function (data) {
|
||||
result = data.d;
|
||||
// addheader();
|
||||
let strHTML = '<tr><th><td>SDL-Nr</td></th><th><td>Bezeichnung</td></th><th><td>Gueltig bis</td></th><th><td>Karten Nummer</td></th></tr>';
|
||||
alert('Horray! 200 status code!');
|
||||
// alert(result.rows.length)
|
||||
$(result).each(function () {
|
||||
let row = $(this)[0];
|
||||
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
|
||||
|
||||
alert(row)
|
||||
$('#<%=tbl_mainpage.ClientID%>').innerHTML = strHTML;
|
||||
});
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
|
||||
}
|
||||
|
||||
});
|
||||
function OnSuccess(result) {
|
||||
addheader();
|
||||
alert('Horray! 200 status code!');
|
||||
alert(result.rows.length)
|
||||
for (let i = 0; i < result.rows.length; i++) {
|
||||
let row = $('<tr><td>' + result.rows[i].SDL + '</td><td>' + result.rows[i].Bez + '</td><td>' + result.rows[i].DateGueltig + '</td><td>' + result.rows[i].KartNr + '</td></tr>');
|
||||
alert(row)
|
||||
}
|
||||
}
|
||||
|
||||
//filltable2(id.split(',')[0])
|
||||
}
|
||||
function doPostBack_M(id_M) {
|
||||
@@ -367,7 +372,7 @@
|
||||
let natplaceholder = document.getElementById('<%=lbl_Placeholder_M.ClientID%>');
|
||||
alert(id_M)
|
||||
let table_M = document.getElementById('<%=tbl_mainpage_M.ClientID%>');
|
||||
var rowCount = table_M.rows.length;
|
||||
let rowCount = table_M.rows.length;
|
||||
|
||||
for (let i = rowCount - 1; i > 0; i--) {
|
||||
table_M.deleteRow(i);
|
||||
@@ -385,32 +390,36 @@
|
||||
//addNewRow(SDL,Bez,Datguenstig,KartNr)
|
||||
// Pagemethods.filltable2(<%' =tbl_mainpage_M%> , SDL, Bez, Datguenstig, KartNr)
|
||||
//}
|
||||
var data = {
|
||||
"Kennzeichen": id_M.split(',')[0]
|
||||
};
|
||||
var data_m = {};
|
||||
data_m['Kennzeichen'] = id.split(',')[0];
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "LKWs.aspx/filltable2_M",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
data: JSON.stringify(data),
|
||||
success: function (result) {
|
||||
OnSuccess_M(result.d);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
|
||||
}
|
||||
data: JSON.stringify(data_m),
|
||||
async: true,
|
||||
success: function (data_m) {
|
||||
result = data_m.d;
|
||||
// addheader();
|
||||
let strHTML = '<tr><th><td> SDL-Nr </td></th><th><td> Bezeichnung </td></th><th><td> Gueltig bis</td></th><th><td>Karten Nummer</td></th></tr>';
|
||||
alert('Horray! 200 status code!');
|
||||
|
||||
$(result).each(function () {
|
||||
let row = $(this)[0];
|
||||
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
|
||||
|
||||
alert(row)
|
||||
$('#<%=tbl_mainpage_M.ClientID%>').innerHTML = strHTML;
|
||||
});
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
|
||||
}
|
||||
|
||||
});
|
||||
function OnSuccess_M(result_M) {
|
||||
addheader_M();
|
||||
alert('Horray! 200 status code!');
|
||||
alert(result_M.rows.length)
|
||||
for (let i = 0; i < result_M.rows.length; i++) {
|
||||
let row = $('<tr><td>' + result_M.rows[i].SDL + '</td><td>' + result_M.rows[i].Bez + '</td><td>' + result_M.rows[i].DateGueltig + '</td><td>' + result_M.rows[i].KartNr + '</td></tr>');
|
||||
alert(row)
|
||||
}
|
||||
}
|
||||
|
||||
//filltable2(id.split(',')[0])
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -400,54 +400,38 @@ Partial Class LKWS
|
||||
|
||||
<WebMethod>
|
||||
<ScriptMethod(ResponseFormat:=ResponseFormat.Json)>
|
||||
Public Shared Function filltable2(Kennzeichen As String) As Table
|
||||
Dim tbl As Table = New Table
|
||||
tbl.EnableViewState = True
|
||||
Public Shared Function filltable2(Kennzeichen As String) As List(Of Entry)
|
||||
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(401940, Kennzeichen)
|
||||
For Each l2 In list2
|
||||
Dim tc_SDLNr As TableCell = New TableCell
|
||||
Dim tc_Bezeichnung As TableCell = New TableCell
|
||||
Dim tc_GueltigBis As TableCell = New TableCell
|
||||
Dim tc_KartNr As TableCell = New TableCell
|
||||
Dim tr As TableRow = New TableRow
|
||||
|
||||
tc_SDLNr.Text = l2.SDLNr.ToString
|
||||
tc_Bezeichnung.Text = l2.Kategorie.ToString
|
||||
tc_GueltigBis.Text = l2.GültigBis.ToString
|
||||
tc_KartNr.Text = l2.KartenNr.ToString
|
||||
tr.Cells.Add(tc_SDLNr)
|
||||
tr.Cells.Add(tc_Bezeichnung)
|
||||
tr.Cells.Add(tc_GueltigBis)
|
||||
tr.Cells.Add(tc_KartNr)
|
||||
tr.Attributes.Add("style", "background-color:#ff2500;color:#fff;font-weight:400;")
|
||||
tbl.Rows.Add(tr)
|
||||
Dim Entrytemp As New Entry
|
||||
Entrytemp.SDL = l2.SDLNr.ToString
|
||||
Entrytemp.Bez = l2.Kategorie.ToString
|
||||
Entrytemp.Gueltigbis = l2.GültigBis.ToString
|
||||
Entrytemp.KartNr = l2.KartenNr.ToString
|
||||
list.Add(Entrytemp)
|
||||
Next
|
||||
Return tbl
|
||||
Return list
|
||||
End Function
|
||||
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
|
||||
End Class
|
||||
<WebMethod>
|
||||
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)>
|
||||
Public Shared Function filltable2_M(Kennzeichen As String) As Table
|
||||
Public Shared Function filltable2_M(Kennzeichen As String) As List(Of Entry)
|
||||
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(401940, Kennzeichen)
|
||||
Dim Tbl As New Table
|
||||
Tbl.EnableViewState = True
|
||||
For Each l2 In list2
|
||||
Dim tc_SDLNr As TableCell = New TableCell
|
||||
Dim tc_Bezeichnung As TableCell = New TableCell
|
||||
Dim tc_GueltigBis As TableCell = New TableCell
|
||||
Dim tc_KartNr As TableCell = New TableCell
|
||||
Dim tr_M As TableRow = New TableRow
|
||||
|
||||
tc_SDLNr.Text = l2.SDLNr.ToString
|
||||
tc_Bezeichnung.Text = l2.Kategorie.ToString
|
||||
tc_GueltigBis.Text = l2.GültigBis.ToString
|
||||
tc_KartNr.Text = l2.KartenNr.ToString
|
||||
tr_M.Cells.Add(tc_SDLNr)
|
||||
tr_M.Cells.Add(tc_Bezeichnung)
|
||||
tr_M.Cells.Add(tc_GueltigBis)
|
||||
tr_M.Cells.Add(tc_KartNr)
|
||||
tr_M.Attributes.Add("style", "background-color:#ff2500;color:#fff;font-weight:400;")
|
||||
Tbl.Rows.Add(tr_M)
|
||||
Dim Entrytemp As New Entry
|
||||
Entrytemp.SDL = l2.SDLNr.ToString
|
||||
Entrytemp.Bez = l2.Kategorie.ToString
|
||||
Entrytemp.Gueltigbis = l2.GültigBis.ToString
|
||||
Entrytemp.KartNr = l2.KartenNr.ToString
|
||||
list.Add(Entrytemp)
|
||||
Next
|
||||
Return Tbl
|
||||
Return list
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user