Пример #1
0
 public void Seleziona(int id, out string gridTempId)
 {
     logger.Debug("SchedaRicerca.Seleziona");
     DocsPaWR.SearchItem item = null;
     try
     {
         gridTempId = string.Empty;
         DocsPaWR.DocsPaWebService docspaws = ProxyManager.getWS();
         logger.Debug("SchedaRicerca.Seleziona - Sto per cercare la ricerca: " + id);
         item = docspaws.RecuperaRicerca(id);
         if (item == null)
         {
             logger.Debug("SchedaRicerca.Seleziona - Ricerca non trovata");
             throw new Exception("Ricerca non trovata");
         }
         else
         {
             logger.Debug("SchedaRicerca.Seleziona - Ricerca trovata");
             if (!string.IsNullOrEmpty(item.gridId))
             {
                 gridTempId = item.gridId;
             }
             logger.Debug("SchedaRicerca.Seleziona - Deserializzazione dei filtri");
             filters = SchedaRicerca.StringToFilters(item.filtri);
             logger.Debug("SchedaRicerca.Seleziona - Filtri deserializzati");
         }
     }
     catch (Exception ex)
     {
         logger.Debug("SchedaRicerca.Seleziona - Errore nella selezione della ricerca: " + ex.Message);
         throw ex;
     }
 }
Пример #2
0
        public void Modifica(string type, bool custumGrid, string gridId, Grid tempGrid, GridTypeEnumeration gridType)
        {
            logger.Debug("SchedaRicerca.Modifica");

            try
            {
                DocsPaWR.DocsPaWebService docspaws = ProxyManager.getWS();
                DocsPaWR.SearchItem       item     = new SAAdminTool.DocsPaWR.SearchItem();
                item.system_id   = nuovaRic.Id;
                item.descrizione = nuovaRic.Titolo;
                item.tipo        = this.tipo;

                switch (nuovaRic.Condivisione)
                {
                case NuovaRicerca.ModoCondivisione.Utente:
                    item.owner_idPeople = Int32.Parse(this.utente.idPeople);
                    break;

                case NuovaRicerca.ModoCondivisione.Ruolo:
                    item.owner_idGruppo = Int32.Parse(this.ruolo.idGruppo);
                    break;

                default:
                    break;
                }

                if (string.IsNullOrEmpty(this._searchKey))
                {
                    item.pagina = this.currentPg.ToString();
                }
                else
                {
                    item.pagina = this._searchKey;
                }

                logger.Debug("SchedaRicerca.Modifica - Serializzazione dei filtri");
                item.filtri = SchedaRicerca.FiltersToString(this.filters);
                logger.Debug("SchedaRicerca.Modifica - Filtri serializzati");

                logger.Debug("SchedaRicerca.Modifica - Sto per modificare la ricerca: " + item.ToString());

                DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente();

                item = docspaws.ModificaRicerca(item, infoUtente, custumGrid, gridId, tempGrid, gridType);

                if (custumGrid)
                {
                    if (!string.IsNullOrEmpty(item.gridId))
                    {
                        GridManager.SelectedGrid = GridManager.GetGridFromSearchId(item.gridId, gridType);
                    }
                }

                logger.Debug("SchedaRicerca.Modifica - Ricerca salvata");
            }
            catch (Exception ex)
            {
                logger.Debug("SchedaRicerca.Salva - Errore nel salvataggio della ricerca: " + ex.Message);
                throw ex;
            }
        }