Test Autocompleter via sql database
This commit is contained in:
42
App_Code/WebService.vb
Normal file
42
App_Code/WebService.vb
Normal file
@@ -0,0 +1,42 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Web
|
||||
Imports System.Web.Services
|
||||
Imports System.Web.Services.Protocols
|
||||
|
||||
' Wenn der Aufruf dieses Webdiensts aus einem Skript zulässig sein soll, heben Sie mithilfe von ASP.NET AJAX die Kommentarmarkierung für die folgende Zeile auf.
|
||||
' <System.Web.Script.Services.ScriptService()> _
|
||||
<WebService(Namespace:="http://tempuri.org/")> _
|
||||
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Public Class WebService
|
||||
Inherits System.Web.Services.WebService
|
||||
|
||||
<WebMethod()>
|
||||
Public Function Show(ByVal sLookUP As String) As List(Of String)
|
||||
Dim lstCountries As New List(Of String)()
|
||||
Dim Connectionstring As String = String.Empty
|
||||
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956"
|
||||
Connectionstring = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
Else
|
||||
Connectionstring = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
|
||||
End If
|
||||
|
||||
Dim myConn As New SqlConnection(Connectionstring)
|
||||
Dim objComm As New SqlCommand("SELECT LKW Kennzeichen FROM FROM [VERAG_HOMEPAGE].[dbo].[Rechnungsausgang] " &
|
||||
"WHERE Kennzeichen LIKE '%'+@LookUP+'%' ORDER BY Kennzeichen", myConn)
|
||||
myConn.Open()
|
||||
|
||||
objComm.Parameters.AddWithValue("@LookUP", sLookUP)
|
||||
Dim reader As SqlDataReader = objComm.ExecuteReader()
|
||||
|
||||
While reader.Read()
|
||||
lstCountries.Add(reader("Kennzeichen").ToString())
|
||||
End While
|
||||
|
||||
myConn.Close() : Return lstCountries
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -117,7 +117,7 @@
|
||||
<%Dim erster = New Date(Now().Year, Now().Month, 1) %>
|
||||
<asp:TextBox id="pickdate1" Type="Date" CssClass="classTarget" minDate="<%=erster %>" OnTextChanged="pickdate1_TextChanged" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ControlToValidate="pickdate1" ID="valreqpickdate1" Display="Dynamic" runat="server" Enabled ="true" Visible ="true"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator runat="server" ID="valDateRange_1" ControlToValidate="pickdate1" Display="Dynamic" onservervalidate="valDateRange_1_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid" />
|
||||
<asp:CustomValidator runat="server" ID="valDateRange_1" ValidateEmptyText="true" ControlToValidate="pickdate1" Display="Dynamic" onservervalidate="valDateRange_1_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid" />
|
||||
<!--<asp:RequiredFieldValidator ID="RequiredFieldValidatorvon" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate1" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ValidateEmptyText="false" ClientValidationFunction="instantValidation"></asp:CustomValidator> -->
|
||||
<asp:Label ID="lbl_bis" runat="server" Text="To:"></asp:Label>
|
||||
@@ -125,7 +125,7 @@
|
||||
<%Dim jetzt = DateTime.Now.Date %>
|
||||
<asp:TextBox id="pickdate2" Type="Date" CssClass="classTarget" minDate="<%=jetzt %>" OnTextChanged="pickdate2_TextChanged" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ControlToValidate="pickdate2" ID="valreqpickdate2" Display="Dynamic" runat="server" Enabled ="true" Visible ="true"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator runat="server" ID="valDateRange_2" ControlToValidate="pickdate2" Display="Dynamic" onservervalidate="valDateRange_2_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid"/>
|
||||
<asp:CustomValidator runat="server" ID="valDateRange_2" ValidateEmptyText="true" ControlToValidate="pickdate2" Display="Dynamic" onservervalidate="valDateRange_2_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid"/>
|
||||
</div>
|
||||
<div id="Abstand"></div>
|
||||
<hr>
|
||||
@@ -150,19 +150,43 @@
|
||||
<div class="row">
|
||||
<div id="rowcol1" class="col-12">
|
||||
<form class="myform" id="commentForm">
|
||||
<asp:Label ID="lbl_LKWNr" runat="server" Text="LKW Nr"></asp:Label>
|
||||
<asp:TextBox ID="txt_LKWNr" runat="server" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_TextChanged"></asp:TextBox>
|
||||
<asp:Label ID="lbl_LKWNr" runat="server" Text="LKW Nr"></asp:Label>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(function () {
|
||||
$('#<%=txt_LKWNr.ClientID%>').autocomplete({
|
||||
source: function (request, response) {
|
||||
$.ajax({
|
||||
url: "CustomsAviso.aspx/GetCompanyName",
|
||||
data: "{ 'pre':'" + request.term + "'}",
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data) {
|
||||
response($.map(data.d, function (item) {
|
||||
return { value: item }
|
||||
}))
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<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]{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:TextBox ID="txt_KdNrAuftrag" runat="server" 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>
|
||||
</form>
|
||||
</div>
|
||||
<div id="rowcol2" class="col-12">
|
||||
<asp:Label ID="lbl_Absender" runat="server" Text="Absender"></asp:Label>
|
||||
<asp:TextBox ID="txt_Absender" runat="server" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_TextChanged"></asp:TextBox>
|
||||
<asp:TextBox ID="txt_Absender" runat="server" AutoCompleteType="DisplayName" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_Absender" runat="server" ID="regexval_txt_Absender" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ForeColor="Red" ErrorMessage="Absender: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
|
||||
<asp:Label ID="lbl_Empfaenger" runat="server" Text="Empfänger" style="margin-left:9px"></asp:Label>
|
||||
<asp:Label ID="lbl_Empfaenger" runat="server" AutoCompleteType="DisplayName" Text="Empfänger" style="margin-left:9px"></asp:Label>
|
||||
<asp:TextBox ID="txt_Empfaenger" runat="server" style="width:155px; margin-left:52px;" OnTextChanged="txt_Empfaenger_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger" runat="server" ID="regexval_txt_Empfaenger" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ForeColor="Red" ErrorMessage="Empfänger: Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
|
||||
</div>
|
||||
@@ -173,22 +197,22 @@
|
||||
<div id="rowcol3" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
|
||||
<div class="row">
|
||||
<asp:Label ID="lbl_LKWNr_M" runat="server" Text="LKW Nr"></asp:Label>
|
||||
<asp:TextBox ID="txt_LKWNr_M" runat="server" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_M_TextChanged"></asp:TextBox>
|
||||
<asp:TextBox ID="txt_LKWNr_M" AutoCompleteType="Search" runat="server" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_M_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_LKWNr" runat="server" ID="regexval_txt_LKWNr_M" ValidationGroup="additional_TXTs" ForeColor="Red" ValidationExpression="^([A-Z0-9]{30})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
|
||||
</div>
|
||||
<div id="rowcol4" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
|
||||
<asp:Label ID="lbl_KdNrAuftrag_M" runat="server" Text="Kunden Auftrags Nr" style="margin-left:45px"></asp:Label>
|
||||
<asp:TextBox ID="txt_KdNrAuftrag_M" runat="server" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_M_TextChanged"></asp:TextBox>
|
||||
<asp:TextBox ID="txt_KdNrAuftrag_M" runat="server" AutoCompleteType="Search" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_M_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_KdNrAuftrag_M" runat="server" ID="regval_txt_KdNrAuftrag_M" ValidationGroup="additional_TXTs" ValidationExpression="^[0-9]{7}$" Display="Dynamic" ForeColor="Red" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
|
||||
</div>
|
||||
<div id="rowcol5" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
|
||||
<asp:Label ID="lbl_Absender_M" runat="server" Text="Absender"></asp:Label>
|
||||
<asp:TextBox ID="txt_Absender_M" runat="server" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_M_TextChanged"></asp:TextBox>
|
||||
<asp:TextBox ID="txt_Absender_M" runat="server" AutoCompleteType="DisplayName" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_M_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_Absender_M" runat="server" ID="regval_txt_Absender_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ForeColor="Red" ErrorMessage="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_Empfaenger_M" runat="server" Text="Empfänger" style="margin-left:9px"></asp:Label>
|
||||
<asp:TextBox ID="txt_Empfaenger_M" runat="server" style="width:155px; margin-left:52px;" OnTextChanged="txt_Empfaenger_M_TextChanged"></asp:TextBox>
|
||||
<asp:TextBox ID="txt_Empfaenger_M" runat="server" AutoCompleteType="DisplayName" style="width:155px; margin-left:52px;" OnTextChanged="txt_Empfaenger_M_TextChanged"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger_M" runat="server" ID="regval_txt_Empfaenger_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" ForeColor="Red" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -908,4 +908,7 @@ Partial Class CustomsAviso
|
||||
Protected Sub txt_KdNrAuftrag_M_TextChanged(sender As Object, e As EventArgs)
|
||||
regval_txt_KdNrAuftrag_M.Validate()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
@@ -33,7 +33,6 @@
|
||||
<asp:ScriptManager ID="script1" runat="server"></asp:ScriptManager>
|
||||
<asp:UpdatePanel ID="panelupdate1" runat="server"><ContentTemplate>
|
||||
<!-- Webiste-Content-->
|
||||
|
||||
|
||||
|
||||
<div id="containerseiterand" style="margin-left:auto;margin-right:auto">
|
||||
@@ -212,6 +211,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate></asp:UpdatePanel>
|
||||
</ContentTemplate></asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
1
WebService.asmx
Normal file
1
WebService.asmx
Normal file
@@ -0,0 +1 @@
|
||||
<%@ WebService Language="VB" CodeBehind="~/App_Code/WebService.vb" Class="WebService" %>
|
||||
Reference in New Issue
Block a user