Пример #1
0
        public override void buildResponse(RicercaRequest request, RicercaResponse response)
        {
            logger.Debug("contenuto del folder con id " + request.ParentFolderId);
            FascicoloContentDecorator <RicercaElement> fcDec = new FascicoloContentDecorator <RicercaElement>(request.UserInfo.IdPeople, request.IdGruppo, request.ParentFolderId, request.FascId, RicercaElement.buildInstance, RicercaElement.buildInstance);
            PaginatorDecorator <RicercaElement>        pag   = new PaginatorDecorator <RicercaElement>(request.RequestedPage, request.PageSize, fcDec);

            response.Risultati        = pag.execute();
            response.TotalRecordCount = pag.TotalResultCount;
        }
Пример #2
0
        public override void buildResponse(RicercaRequest request, RicercaResponse response)
        {
            int numRec;
            int numTotPage;


            //Filtro ricerca temporale -1anno
            FiltroRicerca fascDataPrec = new FiltroRicerca();

            fascDataPrec.argomento = DocsPaVO.filtri.fascicolazione.listaArgomenti.APERTURA_PRECEDENTE_IL.ToString();
            fascDataPrec.valore    = DateTime.Now.Date.AddDays(1).ToString("dd/MM/yyyy");
            FiltroRicerca fascDataSuccAl = new FiltroRicerca();

            fascDataSuccAl.argomento = DocsPaVO.filtri.fascicolazione.listaArgomenti.APERTURA_SUCCESSIVA_AL.ToString();
            fascDataSuccAl.valore    = DateTime.Now.AddYears(-1).Date.ToString("dd/MM/yyyy");



            logger.Debug("ricerca di documenti e fascicoli per testo");
            List <RicercaElement> risultati = new List <RicercaElement>();

            FiltroRicerca[] filtriFasc = new FiltroRicerca[3];
            filtriFasc[0]           = new FiltroRicerca();
            filtriFasc[0].argomento = DocsPaVO.filtri.fascicolazione.listaArgomenti.TITOLO.ToString();
            filtriFasc[0].valore    = request.Text;
            filtriFasc[1]           = fascDataSuccAl;
            filtriFasc[2]           = fascDataPrec;
            InfoUtente iu = request.UserInfo.InfoUtente;

            iu.idGruppo      = request.IdGruppo;
            iu.idCorrGlobali = request.IdCorrGlobali;
            logger.Debug("testo da cercare: " + request.Text);
            List <SearchResultInfo> idProjectList = null;
            //ArrayList resultFasc = BusinessLogic.Fascicoli.FascicoloManager.getListaFascicoliPaging(iu, null, null, filtriFasc, request.EnableUfficioRef, request.EnableProfilazione, true, out numTotPage, out  numRec, request.RequestedPage, request.PageSize, false, out idProjectList, null, string.Empty);



            ArrayList resultFasc = BusinessLogic.Fascicoli.FascicoloManager.getListaFascicoli(iu, null, filtriFasc, request.EnableUfficioRef, request.EnableProfilazione, true, null, null, null);

            logger.Debug("numero totale risultati: " + resultFasc.Count);
            foreach (Fascicolo temp in resultFasc)
            {
                risultati.Add(RicercaElement.buildInstance(temp));
            }
            FiltroRicerca[][]    filtriArrayDoc = new FiltroRicerca[1][];
            List <FiltroRicerca> filtriDoc      = new List <FiltroRicerca>();;

            if (!string.IsNullOrEmpty(request.Text))
            {
                FiltroRicerca fOgg = new FiltroRicerca();
                fOgg.argomento = listaArgomenti.OGGETTO.ToString();
                fOgg.valore    = request.Text;
                filtriDoc.Add(fOgg);
            }
            listaArgomenti[] defaultArgomenti = new listaArgomenti[] {
                listaArgomenti.PROT_ARRIVO,
                listaArgomenti.PROT_PARTENZA,
                listaArgomenti.PROT_INTERNO,
                listaArgomenti.GRIGIO,
                listaArgomenti.PREDISPOSTO
            };
            foreach (listaArgomenti arg in defaultArgomenti)
            {
                FiltroRicerca temp = new FiltroRicerca();
                temp.argomento = arg.ToString();
                temp.valore    = "true";
                filtriDoc.Add(temp);
            }


            //Filtro ricerca temporale -1anno
            FiltroRicerca fDataPrec = new FiltroRicerca();

            fDataPrec.argomento = listaArgomenti.DATA_CREAZIONE_PRECEDENTE_IL.ToString();
            fDataPrec.valore    = DateTime.Now.Date.AddDays(1).ToString("dd/MM/yyyy");
            FiltroRicerca fDataSuccAl = new FiltroRicerca();

            fDataSuccAl.argomento = listaArgomenti.DATA_CREAZIONE_SUCCESSIVA_AL.ToString();
            fDataSuccAl.valore    = DateTime.Now.AddYears(-1).Date.ToString("dd/MM/yyyy");

            filtriDoc.Add(fDataPrec);
            filtriDoc.Add(fDataSuccAl);
            List <SearchResultInfo> idProfileList = new List <SearchResultInfo>();

            filtriArrayDoc[0] = filtriDoc.ToArray();
            //ArrayList resultDoc = BusinessLogic.Documenti.InfoDocManager.getQueryPaging(request.IdGruppo, request.UserInfo.IdPeople, filtriArrayDoc, true, request.RequestedPage, request.PageSize, true, out numTotPage, out numRec, false, out idProfileList, false);
            ArrayList resultDoc = BusinessLogic.Documenti.InfoDocManager.getQuery(request.IdGruppo, request.UserInfo.IdPeople, filtriArrayDoc);

            foreach (InfoDocumento temp in resultDoc)
            {
                risultati.Add(RicercaElement.buildInstance(temp));
            }
            risultati.Sort(new RicercaElementComparer());
            PaginatorDecorator <RicercaElement> pag = new PaginatorDecorator <RicercaElement>(request.RequestedPage, request.PageSize, risultati);

            response.Risultati        = pag.execute();
            response.TotalRecordCount = pag.TotalResultCount;
        }