45 lines
1.6 KiB
C#
45 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Services;
|
|
using System.Web.Script.Services;
|
|
using SteamWare;
|
|
using GPW_data;
|
|
|
|
namespace GPW.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[] ElencoFasi(string searchText)
|
|
{
|
|
// inizializzo risposta
|
|
List<string> suggerimenti = new List<string>();
|
|
// elenco candidati
|
|
GPW_data.DS_Utility.v_selProjFasiDataTable tabella = DataProxy.DP.taVSPF.GetData(searchText);
|
|
// aggiungo ogni riga...
|
|
foreach (GPW_data.DS_Utility.v_selProjFasiRow riga in tabella)
|
|
{
|
|
//suggerimenti.Add(riga.label);
|
|
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();
|
|
}
|
|
}
|
|
}
|