public ListItem[] ElencoRicerche(string tipo, bool allPages, System.Web.UI.WebControls.DropDownList ddl, string selVal) { string selected = selVal; if (ddl != null && selected == null) { selected = (ddl.SelectedIndex > 0) ? ddl.SelectedValue : null; } ListItem[] outcome = null; ArrayList alOutcome = new ArrayList(); try { //1.Carico dal database la lista delle ricerche per l'utente e ruolo corrente DocsPaWR.SearchItemList itemList = docsPaWS.ListaRicercheSalvate(Int32.Parse(this.utente.idPeople), Int32.Parse(this.ruolo.idGruppo), (!allPages) ? this._searchKey.ToString() : null, false, tipo); if (itemList != null) { foreach (DocsPaWR.SearchItem item in itemList.lista) { ListItem li = new ListItem(item.descrizione, item.system_id.ToString()); alOutcome.Add(li); } outcome = new ListItem[alOutcome.Count]; alOutcome.CopyTo(outcome); } } catch (Exception ex) { throw ex; } if (ddl != null) { ddl.Items.Clear(); ddl.Items.Add(new ListItem("", "0")); ddl.Items.AddRange(outcome); if (selected != null) { bool found = false; for (int i = 1; !found && i < ddl.Items.Count; i++) { ListItem li_ = ddl.Items[i]; if (li_.Value == selected) { ddl.SelectedIndex = i; found = true; } } } } return(outcome); }
public ListItem[] ElencoRicerche(string tipo, bool allPages, System.Web.UI.WebControls.DropDownList ddl, string selVal) { string selected = selVal; if (ddl != null && selected == null) { selected = (ddl.SelectedIndex > 0) ? ddl.SelectedValue : null; } ListItem[] outcome = null; ArrayList alOutcome = new ArrayList(); //logger.Debug("SchedaRicerca.ElencoRicerche"); try { //1.Carico dal database la lista delle ricerche per l'utente e ruolo corrente DocsPaWR.DocsPaWebService docspaws = ProxyManager.getWS(); //logger.Debug("SchedaRicerca.ElencoRicerche - Sto per cercare la lista delle ricerche"); DocsPaWR.SearchItemList itemList = docspaws.ListaRicercheSalvate(Int32.Parse(this.utente.idPeople), Int32.Parse(this.ruolo.idGruppo), (!allPages) ? this._searchKey.ToString() : null, false, tipo); if (itemList != null) { //logger.Debug("SchedaRicerca.ElencoRicerche - "+itemList.lista.Length+" ricerche trovate"); foreach (SAAdminTool.DocsPaWR.SearchItem item in itemList.lista) { ListItem li = new ListItem(item.descrizione, item.system_id.ToString()); alOutcome.Add(li); } outcome = new ListItem[alOutcome.Count]; alOutcome.CopyTo(outcome); } } catch (Exception ex) { logger.Debug("SchedaRicerca.ElencoRicerche - Errore nel recupero della lista delle ricerche: " + ex.Message); throw ex; } if (ddl != null) { ddl.Items.Clear(); ddl.Items.Add(new ListItem("", "0")); ddl.Items.AddRange(outcome); if (selected != null) { bool found = false; for (int i = 1; !found && i < ddl.Items.Count; i++) { ListItem li_ = ddl.Items[i]; if (li_.Value == selected) { ddl.SelectedIndex = i; found = true; } } } } return(outcome); }