42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using CMS_SC_Data;
|
|
using SteamWare;
|
|
using System.Collections.Generic;
|
|
using System.Web.Script.Services;
|
|
using System.Web.Services;
|
|
|
|
namespace CMS_SC.Services
|
|
{
|
|
/// <summary>
|
|
/// Servizi web x retrieve dati interattivo
|
|
/// </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 WS_data : System.Web.Services.WebService
|
|
{
|
|
[WebMethod]
|
|
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
|
|
public string[] Macchine(string prefixText)
|
|
{
|
|
// inizializzo risposta
|
|
List<string> suggerimenti = new List<string>();
|
|
// elenco candidati
|
|
CMS_SC_Data.DS_Utility.v_selMacchineDataTable tabella = DtProxy.man.taVSMacc.searchLike(prefixText);
|
|
// aggiungo ogni riga...
|
|
foreach (CMS_SC_Data.DS_Utility.v_selMacchineRow riga in tabella)
|
|
{
|
|
suggerimenti.Add(string.Format("{0}#{1}", riga.label, riga.value));
|
|
if (suggerimenti.Count == memLayer.ML.confReadInt("maxNumSuggest"))
|
|
{
|
|
suggerimenti.Add("...#");
|
|
return suggerimenti.ToArray();
|
|
}
|
|
}
|
|
return suggerimenti.ToArray();
|
|
}
|
|
|
|
}
|
|
}
|