Files
MoonPro.net/MP-Admin/WS/AutoCompletamento.asmx.cs
T
2017-04-14 13:53:20 +02:00

43 lines
1.5 KiB
C#

using SteamWare;
using System.Collections.Generic;
using System.Web.Services;
namespace MoonProAdmin.WS
{
/// <summary>
/// servizi per AutoCompletamento oggetti
/// </summary>
[WebService(Namespace = "http://www.steamware.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class AutoCompletamento : System.Web.Services.WebService
{
/// <summary>
/// elenco articoli per ricerca interattiva
/// </summary>
/// <returns></returns>
[WebMethod(Description = "elenco articoli per ricerca interattiva")]
public string[] elencoArticoli(string prefixText, int count)
{
// inizializzo risposta
List<string> suggerimenti = new List<string>();
// proseguo SOLO SE min "MinCharAutocomplete" char...
if (count >= memLayer.ML.confReadInt("MinCharAutocomplete"))
{
// elenco candidati
MapoDb.DS_Utility.v_selArticoliDataTable tabDati = MapoDb.DataLayer.obj.taSelArt.getByConditio(prefixText);
// aggiungo ogni riga...
foreach (MapoDb.DS_Utility.v_selArticoliRow riga in tabDati)
{
suggerimenti.Add(riga.value);
}
}
return suggerimenti.ToArray();
}
}
}