Änderungen zur Implementierung einer automatsicnen Autovervollständigungs "KI"

This commit is contained in:
ja
2021-11-09 15:58:21 +01:00
parent 58f4a16781
commit 8971416b81
4 changed files with 8 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ Public Class WebService
Inherits System.Web.Services.WebService Inherits System.Web.Services.WebService
<WebMethod()> <WebMethod()>
Public Function Show(ByVal sLookUP As String) As List(Of String) Public Function ShowLKWs(ByVal sLookUP As String) As List(Of String)
Dim lstCountries As New List(Of String)() Dim lstCountries As New List(Of String)()
Dim Connectionstring As String = String.Empty Dim Connectionstring As String = String.Empty

View File

@@ -151,12 +151,12 @@
<div id="rowcol1" class="col-12"> <div id="rowcol1" class="col-12">
<form class="myform" id="commentForm"> <form class="myform" id="commentForm">
<asp:Label ID="lbl_LKWNr" runat="server" Text="LKW Nr"></asp:Label> <asp:Label ID="lbl_LKWNr" runat="server" Text="LKW Nr"></asp:Label>
<script language="javascript" type="text/javascript"> <!-- <script language="javascript" type="text/javascript">
$(function () { $(function () {
$('#<%=txt_LKWNr.ClientID%>').autocomplete({ $('#<%=txt_LKWNr.ClientID%>').autocomplete({
source: function (request, response) { source: function (request, response) {
$.ajax({ $.ajax({
url: "CustomsAviso.aspx/GetCompanyName", url: "WebService.asmx/ShowLKWs",
data: "{ 'pre':'" + request.term + "'}", data: "{ 'pre':'" + request.term + "'}",
dataType: "json", dataType: "json",
type: "POST", type: "POST",
@@ -173,10 +173,9 @@
} }
}); });
}); });
</script> </script>-->
<asp:TextBox ID="txt_LKWNr" runat="server" AutoCompleteType="Search" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_TextChanged"></asp:TextBox> <asp:TextBox ID="txt_LKWNr" runat="server" AutoCompleteType="Search" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator ControlToValidate="txt_LKWNr" runat="server" ID="regexval_txt_LKW" ValidationGroup="additional_TXTs" ValidationExpression="([A-Z0-9]{5,30})" Display="Dynamic" ErrorMessage="Falsches Kennzeichenformat!" ForeColor="Red" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ControlToValidate="txt_LKWNr" runat="server" ID="regexval_txt_LKW" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{30})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" ForeColor="Red" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:Label ID="lbl_KdNrAuftrag" runat="server" Text="Kunden Auftrags Nr" style="margin-left:45px"></asp:Label> <asp:Label ID="lbl_KdNrAuftrag" runat="server" Text="Kunden Auftrags Nr" style="margin-left:45px"></asp:Label>
<asp:TextBox ID="txt_KdNrAuftrag" runat="server" AutoCompleteType="Search" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_TextChanged"></asp:TextBox> <asp:TextBox ID="txt_KdNrAuftrag" runat="server" AutoCompleteType="Search" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator ControlToValidate="txt_KdNrAuftrag" runat="server" ID="regexval_txt_KdNrAuftrag" ValidationGroup="additional_TXTs" ValidationExpression="[0-9]{7}" Display="Dynamic" ForeColor="Red" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ControlToValidate="txt_KdNrAuftrag" runat="server" ID="regexval_txt_KdNrAuftrag" ValidationGroup="additional_TXTs" ValidationExpression="[0-9]{7}" Display="Dynamic" ForeColor="Red" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>

View File

@@ -495,7 +495,7 @@ Partial Class CustomsAviso
regval_txt_KdNrAuftrag_M.ForeColor = Drawing.Color.Red regval_txt_KdNrAuftrag_M.ForeColor = Drawing.Color.Red
regval_txt_KdNrAuftrag_M.ErrorMessage = "Die Kundennummer ist nicht richtig formatiert." regval_txt_KdNrAuftrag_M.ErrorMessage = "Die Kundennummer ist nicht richtig formatiert."
End If End If
ElseIf String.IsNullOrEmpty(txt_LKWNr_M.Text) = False Then ElseIf txt_LKWNr_M.Text IsNot "" Then
txt_LKWNr_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled txt_LKWNr_M.ValidateRequestMode = UI.ValidateRequestMode.Enabled
regexval_txt_LKWNr_M.Enabled = True regexval_txt_LKWNr_M.Enabled = True
regexval_txt_LKWNr_M.Validate() regexval_txt_LKWNr_M.Validate()

View File

@@ -222,7 +222,7 @@
$("#txt_LKW").autocomplete({ $("#txt_LKW").autocomplete({
source: function(request, response) { source: function(request, response) {
$.ajax({ $.ajax({
url: "WebService.asmx/Show", url: "WebService.asmx/ShowLKWs",
data: "{ 'sLookUP': '" + request.term + "' }", data: "{ 'sLookUP': '" + request.term + "' }",
dataType: "json", dataType: "json",
type: "POST", type: "POST",