Ejemplo n.º 1
0
        private string moveFascInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            if (SiteNavigation.CallContextStack.CallerContext != null)
            {
                //Verifico in che direzione muovermi
                if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
                {
                    objScrollElementsList.selectedElement++;
                    SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["fascIndex"] = objScrollElementsList.selectedElement.ToString();
                }
                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement--;
                    SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["fascIndex"] = objScrollElementsList.selectedElement.ToString();
                }
            }

            if (objScrollElementsList.objList != null)
            {
                DocsPaWR.SearchObject fasc = (DocsPaWR.SearchObject)objScrollElementsList.objList[objScrollElementsList.selectedElement];

                //DocsPaWR.Fascicolo fasc = (DocsPaWR.Fascicolo)objScrollElementsList.objList[objScrollElementsList.selectedElement];

                DocsPaWR.Fascicolo newfasc = FascicoliManager.getFascicoloById(page, fasc.SearchObjectID);

                if (fasc != null)
                {
                    script = ScrollManager.refreshPage(newfasc, page);
                }
            }

            return(script);
        }
Ejemplo n.º 2
0
        private string moveToDoListInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            SAAdminTool.DocsPaWR.Trasmissione[] dettTrasm = null;

            if (SiteNavigation.CallContextStack.CallerContext != null)
            {
                //Verifico in che direzione muovermi
                if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
                {
                    objScrollElementsList.selectedElement++;

                    //Recupero il dettaglio della trasissione
                    dettTrasm = TrasmManager.trasmGetDettaglioTrasmissione(UserManager.getUtente(page), UserManager.getRuolo(page), (SAAdminTool.DocsPaWR.infoToDoList)objScrollElementsList.objList[objScrollElementsList.selectedElement]);
                    if (dettTrasm != null)
                    {
                        SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["idTrasm"] = dettTrasm[0].systemId;
                    }
                }
                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement--;

                    //Recupero il dettaglio della trasissione
                    dettTrasm = TrasmManager.trasmGetDettaglioTrasmissione(UserManager.getUtente(page), UserManager.getRuolo(page), (SAAdminTool.DocsPaWR.infoToDoList)objScrollElementsList.objList[objScrollElementsList.selectedElement]);
                    if (dettTrasm != null)
                    {
                        SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["idTrasm"] = dettTrasm[0].systemId;
                    }
                }
            }

            if (objScrollElementsList.objList != null)
            {
                //Recupero l'infoDocumento o l'infoFascicolo dal dettaglio della trasmissione
                if (dettTrasm != null && dettTrasm[0].infoDocumento != null && !string.IsNullOrEmpty(dettTrasm[0].infoDocumento.idProfile))
                {
                    DocsPaWR.InfoDocumento doc = dettTrasm[0].infoDocumento;

                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(doc, page);
                    }
                }

                if (dettTrasm != null && dettTrasm[0].infoFascicolo != null && !string.IsNullOrEmpty(dettTrasm[0].infoFascicolo.idFascicolo))
                {
                    DocsPaWR.InfoFascicolo fasc = dettTrasm[0].infoFascicolo;

                    if (fasc != null)
                    {
                        script = ScrollManager.refreshPage(fasc, page);
                    }
                }
            }

            return(script);
        }
Ejemplo n.º 3
0
        private string moveTrasmInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            SAAdminTool.DocsPaWR.Trasmissione trasm = null;

            if (SiteNavigation.CallContextStack.CallerContext != null)
            {
                //Verifico in che direzione muovermi
                if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
                {
                    objScrollElementsList.selectedElement++;

                    //Recupero la trasmissione
                    trasm = (SAAdminTool.DocsPaWR.Trasmissione)objScrollElementsList.objList[objScrollElementsList.selectedElement];
                    if (trasm != null)
                    {
                        SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["docIndex"] = objScrollElementsList.selectedElement.ToString();
                    }
                }
                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement--;

                    //Recupero la trasmissione
                    trasm = (SAAdminTool.DocsPaWR.Trasmissione)objScrollElementsList.objList[objScrollElementsList.selectedElement];
                    if (trasm != null)
                    {
                        SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["docIndex"] = objScrollElementsList.selectedElement.ToString();
                    }
                }
            }

            if (objScrollElementsList.objList != null)
            {
                //Recupero l'infoDocumento o l'infoFascicolo dal dettaglio della trasmissione
                if (trasm != null && trasm.infoDocumento != null && !string.IsNullOrEmpty(trasm.infoDocumento.idProfile))
                {
                    DocsPaWR.InfoDocumento doc = trasm.infoDocumento;

                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(doc, page);
                    }
                }

                if (trasm != null && trasm.infoFascicolo != null && !string.IsNullOrEmpty(trasm.infoFascicolo.idFascicolo))
                {
                    DocsPaWR.InfoFascicolo fasc = trasm.infoFascicolo;

                    if (fasc != null)
                    {
                        script = ScrollManager.refreshPage(fasc, page);
                    }
                }
            }

            return(script);
        }
Ejemplo n.º 4
0
        private DocsPaWR.SearchObject[] searchFasc(ObjScrollElementsList objScrollElementsList, Page page)
        {
            SAAdminTool.DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente(page);
            DocsPaWR.Registro userReg = UserManager.getRegistroSelezionato(page);
            DocsPaWR.FascicolazioneClassificazione classificazione; //= FascicoliManager.getClassificazioneSelezionata(page);

            // Caricamento della classifiazione dal livello di call context inferiore (se esiste)
            if (CallContextStack.CallerContext.ContextState.ContainsKey("Classification"))
            {
                classificazione = CallContextStack.CallerContext.ContextState["Classification"] as DocsPaWR.FascicolazioneClassificazione;
            }
            else
            {
                classificazione = FascicoliManager.getClassificazioneSelezionata(page);
            }

            bool allClass = FascicoliManager.getAllClassValue(page);

            SAAdminTool.DocsPaWR.FiltroRicerca[][] listaFiltri = null;
            SAAdminTool.DocsPaWR.SearchObject[]    listaFasc   = null;

            // Non utilizzato
            SearchResultInfo[] idProjects = null;

            switch (objScrollElementsList.searchContext)
            {
            case ObjScrollElementsList.EmunSearchContext.RICERCA_FASCICOLI:
                listaFiltri = FascicoliManager.getMemoriaFiltriRicFasc(page);

                // Se non ci sono filtri vengono caricati quelli per la nuova ricerca
                if (listaFiltri == null)
                {
                    listaFiltri = CallContextStack.CallerContext.ContextState["SearchFilters"] as FiltroRicerca[][];
                }

                // listaFasc = FascicoliManager.getListaFascicoliPaging(page, classificazione, userReg, listaFiltri[0], allClass, objScrollElementsList.selectedPage + 1, out objScrollElementsList.totalNumberOfPage, out objScrollElementsList.totalNumberOfElements, objScrollElementsList.pageSize, false, out idProjects, null);
                listaFasc = FascicoliManager.getListaFascicoliPagingCustom(page, classificazione, userReg, listaFiltri[0], allClass, objScrollElementsList.selectedPage + 1, out objScrollElementsList.totalNumberOfPage, out objScrollElementsList.totalNumberOfElements, objScrollElementsList.pageSize, false, out idProjects, null, GridManager.IsRoleEnabledToUseGrids(), false, null, null, true);
                break;
            }

            return(listaFasc);
        }
Ejemplo n.º 5
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            #region Codice che gestisce lo scroll di elementi in sessione
            //if (Session["ObjScrollElementsList"] != null && ScrollManager.enableScrollElementsList())
            //{
            //    objScrollElementsList = (ObjScrollElementsList)Session["ObjScrollElementsList"];
            //    setLabelAndButton(objScrollElementsList);
            //}
            #endregion

            #region Codice che gestisce lo scroll di elementi nel CONTEXT (tasto back)
            if (SiteNavigation.CallContextStack.CallerContext != null && SiteNavigation.CallContextStack.CallerContext.objScrollElementsList != null && ScrollManager.enableScrollElementsList())
            {
                objScrollElementsList = ScrollManager.getFromContextObjScrollElementsList();
                setLabelAndButton(objScrollElementsList);
            }
            else
            {
                this.Visible = false;
            }
            #endregion
        }
Ejemplo n.º 6
0
        private DocsPaWR.Trasmissione[] searchTrasm(ObjScrollElementsList objScrollElementsList, Page page)
        {
            SAAdminTool.DocsPaWR.FiltroRicerca[] filtri       = null;
            SAAdminTool.DocsPaWR.Trasmissione[]  listaTram    = null;
            DocsPaWR.TrasmissioneOggettoTrasm    oggettoTrasm = new SAAdminTool.DocsPaWR.TrasmissioneOggettoTrasm();

            switch (objScrollElementsList.searchContext)
            {
            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                filtri = SAAdminTool.DocumentManager.getFiltroRicTrasm(page);
                if (SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["verso"].ToString().ToUpper() == "R".ToUpper())
                {
                    listaTram = SAAdminTool.TrasmManager.getQueryRicevutePaging(page, oggettoTrasm, UserManager.getUtente(page), UserManager.getRuolo(page), filtri, objScrollElementsList.selectedPage + 1, out objScrollElementsList.totalNumberOfPage, out objScrollElementsList.totalNumberOfElements);
                }
                if (SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["verso"].ToString().ToUpper() == "E".ToUpper())
                {
                    listaTram = SAAdminTool.TrasmManager.getQueryEffettuatePaging(page, oggettoTrasm, UserManager.getUtente(page), UserManager.getRuolo(page), filtri, objScrollElementsList.selectedPage + 1, out objScrollElementsList.totalNumberOfPage, out objScrollElementsList.totalNumberOfElements);
                }
                break;
            }

            return(listaTram);
        }
Ejemplo n.º 7
0
        private string moveTrasmNotInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            SAAdminTool.DocsPaWR.Trasmissione[] listaTram = null;
            SAAdminTool.DocsPaWR.Trasmissione   trasm     = null;

            //Recupero i filtri di ricerca ed effettuo la nuova ricerca
            if (SiteNavigation.CallContextStack.CallerContext != null)
            {
                //Verifico in che direzione muovermi
                if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
                {
                    objScrollElementsList.selectedElement = 0;
                    objScrollElementsList.selectedPage++;
                    SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["docIndex"] = "0";
                    SiteNavigation.CallContextStack.CallerContext.PageNumber = objScrollElementsList.selectedPage + 1;

                    //Effettuo una nuova ricerca
                    listaTram = searchTrasm(objScrollElementsList, page);
                    if (listaTram != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaTram);
                        trasm = (DocsPaWR.Trasmissione)objScrollElementsList.objList[0];
                    }
                }

                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement = objScrollElementsList.pageSize - 1;
                    objScrollElementsList.selectedPage--;
                    SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["docIndex"] = (objScrollElementsList.pageSize - 1).ToString();
                    SiteNavigation.CallContextStack.CallerContext.PageNumber = objScrollElementsList.selectedPage + 1;

                    //Effettuo una nuova ricerca
                    listaTram = searchTrasm(objScrollElementsList, page);
                    if (listaTram != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaTram);
                        trasm = (DocsPaWR.Trasmissione)objScrollElementsList.objList[objScrollElementsList.pageSize - 1];
                    }
                }
            }

            if (objScrollElementsList.objList != null)
            {
                //Recupero l'infoDocumento o l'infoFascicolo dal dettaglio della trasmissione
                if (trasm != null && trasm.infoDocumento != null && !string.IsNullOrEmpty(trasm.infoDocumento.idProfile))
                {
                    DocsPaWR.InfoDocumento doc = trasm.infoDocumento;

                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(doc, page);
                    }
                }

                if (trasm != null && trasm.infoFascicolo != null && !string.IsNullOrEmpty(trasm.infoFascicolo.idFascicolo))
                {
                    DocsPaWR.InfoFascicolo fasc = trasm.infoFascicolo;

                    if (fasc != null)
                    {
                        script = ScrollManager.refreshPage(fasc, page);
                    }
                }
            }

            return(script);
        }
Ejemplo n.º 8
0
        private string moveToDoListNotInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            SAAdminTool.DocsPaWR.Trasmissione[] dettTrasm = null;

            //Recupero i filtri di ricerca ed effettuo la nuova ricerca
            if (SiteNavigation.CallContextStack.CallerContext != null)
            {
                //Verifico in che direzione muovermi
                if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
                {
                    objScrollElementsList.selectedElement = 0;
                    objScrollElementsList.selectedPage++;

                    //Effettuo una nuova ricerca
                    SAAdminTool.DocsPaWR.infoToDoList[] listInfoToDoList = null;
                    int totalTrasmNonViste = 0;
                    if (objScrollElementsList.searchContext == ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST)
                    {
                        listInfoToDoList =
                            TrasmManager.getMyNewTodolist(getListaRegistri(UserManager.getRuolo().registri),
                                                          DocumentManager.getFiltroRicTrasm(page),
                                                          objScrollElementsList.selectedPage + 1,
                                                          objScrollElementsList.pageSize,
                                                          out objScrollElementsList.totalNumberOfElements,
                                                          out totalTrasmNonViste);
                    }
                    //listInfoToDoList = TrasmManager.getMyTodolist("D", getListaRegistri(UserManager.getRuolo().registri), DocumentManager.getFiltroRicTrasm(page), objScrollElementsList.selectedPage + 1, objScrollElementsList.pageSize, out objScrollElementsList.totalNumberOfElements);))
                    if (objScrollElementsList.searchContext == ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST)
                    {
                        TrasmManager.getMyNewTodolist(getListaRegistri(UserManager.getRuolo().registri),
                                                      DocumentManager.getFiltroRicTrasm(page),
                                                      objScrollElementsList.selectedPage + 1,
                                                      objScrollElementsList.pageSize,
                                                      out objScrollElementsList.totalNumberOfElements,
                                                      out totalTrasmNonViste);
                    }
                    //listInfoToDoList = TrasmManager.getMyTodolist("F", getListaRegistri(UserManager.getRuolo().registri), DocumentManager.getFiltroRicTrasm(page), objScrollElementsList.selectedPage + 1, objScrollElementsList.pageSize, out objScrollElementsList.totalNumberOfElements);

                    //Il risultato della ricerca potrebbe essere vuoto in quanto le trasmissioni che si stanno scorrendo vengono contestualmente rimosse dalla toDoList
                    if (listInfoToDoList != null && listInfoToDoList.Length != 0)
                    {
                        objScrollElementsList.objList = new ArrayList(listInfoToDoList);

                        //Recupero il dettaglio della trasmissione
                        dettTrasm = TrasmManager.trasmGetDettaglioTrasmissione(UserManager.getUtente(page), UserManager.getRuolo(page), (SAAdminTool.DocsPaWR.infoToDoList)objScrollElementsList.objList[objScrollElementsList.selectedElement]);
                        if (dettTrasm != null)
                        {
                            SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["idTrasm"] = dettTrasm[0].systemId;
                            SiteNavigation.CallContextStack.CallerContext.PageNumber = objScrollElementsList.selectedPage + 1;
                        }
                    }
                    else
                    {
                        if (SiteNavigation.CallContextStack.CallerContext != null)
                        {
                            SiteNavigation.CallContextStack.CallerContext.objScrollElementsList = null;
                        }
                        objScrollElementsList.objList = null;
                    }
                }

                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement = objScrollElementsList.pageSize - 1;
                    objScrollElementsList.selectedPage--;
                    int totalTrasmNonViste = 0;
                    //Effettuo una nuova ricerca
                    SAAdminTool.DocsPaWR.infoToDoList[] listInfoToDoList = null;
                    if (objScrollElementsList.searchContext == ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST)
                    {
                        listInfoToDoList =
                            TrasmManager.getMyNewTodolist(getListaRegistri(UserManager.getRuolo().registri),
                                                          DocumentManager.getFiltroRicTrasm(page),
                                                          objScrollElementsList.selectedPage + 1,
                                                          objScrollElementsList.pageSize,
                                                          out objScrollElementsList.totalNumberOfElements,
                                                          out totalTrasmNonViste);
                    }
                    //listInfoToDoList = TrasmManager.getMyTodolist("D", getListaRegistri(UserManager.getRuolo().registri), DocumentManager.getFiltroRicTrasm(page), objScrollElementsList.selectedPage + 1, objScrollElementsList.pageSize, out objScrollElementsList.totalNumberOfElements);
                    if (objScrollElementsList.searchContext == ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST)
                    {
                        listInfoToDoList =
                            TrasmManager.getMyNewTodolist(getListaRegistri(UserManager.getRuolo().registri),
                                                          DocumentManager.getFiltroRicTrasm(page),
                                                          objScrollElementsList.selectedPage + 1,
                                                          objScrollElementsList.pageSize,
                                                          out objScrollElementsList.totalNumberOfElements,
                                                          out totalTrasmNonViste);
                    }
                    //listInfoToDoList = TrasmManager.getMyTodolist("F", getListaRegistri(UserManager.getRuolo().registri), DocumentManager.getFiltroRicTrasm(page), objScrollElementsList.selectedPage + 1, objScrollElementsList.pageSize, out objScrollElementsList.totalNumberOfElements);

                    //Il risultato della ricerca potrebbe essere vuoto in quanto le trasmissioni che si stanno scorrendo vengono contestualmente rimosse dalla toDoList
                    if (listInfoToDoList != null && listInfoToDoList.Length != 0)
                    {
                        objScrollElementsList.objList = new ArrayList(listInfoToDoList);

                        //Recupero il dettaglio della trasmissione
                        dettTrasm = TrasmManager.trasmGetDettaglioTrasmissione(UserManager.getUtente(page), UserManager.getRuolo(page), (SAAdminTool.DocsPaWR.infoToDoList)objScrollElementsList.objList[objScrollElementsList.selectedElement]);
                        if (dettTrasm != null)
                        {
                            SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["idTrasm"] = dettTrasm[0].systemId;
                            SiteNavigation.CallContextStack.CallerContext.PageNumber = objScrollElementsList.selectedPage + 1;
                        }
                    }
                    else
                    {
                        if (SiteNavigation.CallContextStack.CallerContext != null)
                        {
                            SiteNavigation.CallContextStack.CallerContext.objScrollElementsList = null;
                        }
                        objScrollElementsList.objList = null;
                    }
                }
            }

            if (objScrollElementsList.objList != null)
            {
                //Recupero l'infoDocumento o l'infoFascicolo dal dettaglio della trasmissione
                if (dettTrasm != null && dettTrasm[0].infoDocumento != null && !string.IsNullOrEmpty(dettTrasm[0].infoDocumento.idProfile))
                {
                    DocsPaWR.InfoDocumento doc = dettTrasm[0].infoDocumento;

                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(doc, page);
                    }
                }

                if (dettTrasm != null && dettTrasm[0].infoFascicolo != null && !string.IsNullOrEmpty(dettTrasm[0].infoFascicolo.idFascicolo))
                {
                    DocsPaWR.InfoFascicolo fasc = dettTrasm[0].infoFascicolo;

                    if (fasc != null)
                    {
                        script = ScrollManager.refreshPage(fasc, page);
                    }
                }
            }

            return(script);
        }
Ejemplo n.º 9
0
        public override string move(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            //N.B. I casi di primo e ultimo elemento non vengono gestiti perchè
            //il pulsante next è disabilitato in caso ci si trova all'ultimo elemento ed
            //il pulsante prev è disabilitato in caso ci si trova al primo elemento

            //Mi muovo in avanti
            if (scrollDirection == ScrollManager.ScrollDirection.NEXT)
            {
                //Non siamo a fine pagina, vanno aggiornati i dati
                if (objScrollElementsList.selectedElement + 1 != objScrollElementsList.pageSize)
                {
                    switch (objScrollElementsList.searchContext)
                    {
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
                        return(this.moveToDoListInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
                        return(this.moveToDoListInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                        return(this.moveTrasmInPage(objScrollElementsList, page, scrollDirection));

                        break;
                    }
                }

                //Siamo a fine pagina, va rifatta la ricerca e aggiornati i dati
                if (objScrollElementsList.selectedElement + 1 == objScrollElementsList.pageSize)
                {
                    switch (objScrollElementsList.searchContext)
                    {
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
                        return(this.moveToDoListNotInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
                        return(this.moveToDoListNotInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                        return(this.moveTrasmNotInPage(objScrollElementsList, page, scrollDirection));

                        break;
                    }
                }
            }

            //Mi muovo indietro
            if (scrollDirection == ScrollManager.ScrollDirection.PREV)
            {
                //Non siamo a inizio pagina, vanno aggiornati i dati
                if (objScrollElementsList.selectedElement != 0)
                {
                    switch (objScrollElementsList.searchContext)
                    {
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
                        return(this.moveToDoListInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
                        return(this.moveToDoListInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                        return(this.moveTrasmInPage(objScrollElementsList, page, scrollDirection));

                        break;
                    }
                }

                //Siamo a inizio pagina, va rifatta la ricerca e aggiornati i dati
                if (objScrollElementsList.selectedElement == 0)
                {
                    switch (objScrollElementsList.searchContext)
                    {
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
                        return(this.moveToDoListNotInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
                        return(this.moveToDoListNotInPage(objScrollElementsList, page, scrollDirection));

                        break;

                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                    case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                        return(this.moveTrasmNotInPage(objScrollElementsList, page, scrollDirection));

                        break;
                    }
                }
            }

            return(string.Empty);
        }
Ejemplo n.º 10
0
        private void setLabelAndButton(ObjScrollElementsList objScrollElementsList)
        {
            //Calcolo l'elemento selezionato
            int selectedElement = (objScrollElementsList.selectedElement + 1) + (objScrollElementsList.pageSize * objScrollElementsList.selectedPage);

            //Imposto la label dello UserControl
            switch (objScrollElementsList.searchContext)
            {
            case ObjScrollElementsList.EmunSearchContext.RICERCA_DOCUMENTI:
                lbl_ScrollElementsList.Text = "Doc. " + selectedElement + "/" + objScrollElementsList.totalNumberOfElements + " - Pag. " + (objScrollElementsList.selectedPage + 1);
                break;

            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                lbl_ScrollElementsList.Text = "Trasm. Doc. " + selectedElement + "/" + objScrollElementsList.totalNumberOfElements + " - Pag. " + (objScrollElementsList.selectedPage + 1);
                break;

            case ObjScrollElementsList.EmunSearchContext.RICERCA_DOC_IN_FASC:
                lbl_ScrollElementsList.Text = "Doc. in Fasc. " + selectedElement + "/" + objScrollElementsList.totalNumberOfElements + " - Pag. " + (objScrollElementsList.selectedPage + 1);
                break;

            case ObjScrollElementsList.EmunSearchContext.RICERCA_FASCICOLI:
                lbl_ScrollElementsList.Text = "Fasc. " + selectedElement + "/" + objScrollElementsList.totalNumberOfElements + " - Pag. " + (objScrollElementsList.selectedPage + 1);
                break;

            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
            case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                lbl_ScrollElementsList.Text = "Trasm. Fasc. " + selectedElement + "/" + objScrollElementsList.totalNumberOfElements + " - Pag. " + (objScrollElementsList.selectedPage + 1);
                break;
            }

            //Il risultato della ricerca è costituito da un solo elemento, entrambi i bottoni disabilitati
            if (objScrollElementsList.totalNumberOfElements == 1)
            {
                btn_ScrollPrev.Enabled = false;
                btn_ScrollNext.Enabled = false;
                return;
            }

            //Selezionato il primo elemento
            if (objScrollElementsList.selectedElement == 0 && objScrollElementsList.selectedPage == 0)
            {
                btn_ScrollPrev.Enabled = false;
                btn_ScrollNext.Enabled = true;
                return;
            }

            //Selezionato l'ultimo elemento
            if (selectedElement == objScrollElementsList.totalNumberOfElements)
            {
                btn_ScrollNext.Enabled = false;
                btn_ScrollPrev.Enabled = true;
                return;
            }

            //Selezionato un elemento non iniziale o finale
            btn_ScrollPrev.Enabled = true;
            btn_ScrollNext.Enabled = true;

            //aggiunto per risolvere il problema in cui se da un documento di una ricerca si entra nel dettaglio del suo allegato,
            // premendo il tasto back si ritorna al documento ma le freccette riportano doc 0 di n permettendo il click sul tasto indietro
            if (selectedElement == 0)
            {
                btn_ScrollPrev.Enabled = false;
            }

            return;
        }
Ejemplo n.º 11
0
        protected void btn_Scroll_Click(object sender, ImageClickEventArgs e)
        {
            objScrollElementsList = ScrollManager.getFromContextObjScrollElementsList();

            if (Session["dictionaryCorrispondente"] != null)
            {
                Session.Remove("dictionaryCorrispondente");
            }

            if (objScrollElementsList != null)
            {
                //Controllo che tipo di scorrimento va fatto "NEXT" o "PREV"
                ImageButton imgBtn = (ImageButton)sender;
                ScrollManager.ScrollDirection scrollDirection = ScrollManager.ScrollDirection.NO_DIRECTION;
                if (imgBtn.ID == "btn_ScrollNext")
                {
                    scrollDirection = ScrollManager.ScrollDirection.NEXT;
                }
                if (imgBtn.ID == "btn_ScrollPrev")
                {
                    scrollDirection = ScrollManager.ScrollDirection.PREV;
                }

                string        script = string.Empty;
                ScrollManager scrollManager;

                /*    //Work-Around per capire se il next o prev cambia categoria
                 *
                 *  string IdDoc = "";
                 *  string IdFasc = "";
                 *  string whatisit = "";
                 *  ArrayList list = new ArrayList();
                 *
                 *  switch (scrollDirection)
                 *  {
                 *      case ScrollManager.ScrollDirection.NEXT:
                 *
                 *          list = objScrollElementsList.objList;
                 *          if (objScrollElementsList.selectedElement.Equals(7))
                 *          {
                 *              IdDoc =
                 *                  ((SAAdminTool.DocsPaWR.infoToDoList) (list[0])).
                 *                      sysIdDoc;
                 *              IdFasc = ((SAAdminTool.DocsPaWR.infoToDoList)(list[0])).sysIdFasc;
                 *          }
                 *          else
                 *          {
                 *              IdDoc =
                 *                  ((SAAdminTool.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement + 1])).
                 *                      sysIdDoc;
                 *              IdFasc = ((SAAdminTool.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement +1])).sysIdFasc;
                 *          }
                 *
                 *          if (string.IsNullOrEmpty(IdDoc))
                 *          {
                 *              whatisit = "F";
                 *              objScrollElementsList.searchContext =
                 *                  ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST;
                 *          }
                 *          else if(string.IsNullOrEmpty(IdFasc))
                 *          {
                 *              whatisit = "D";
                 *              objScrollElementsList.searchContext =
                 *                  ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST;
                 *          }
                 *          break;
                 *
                 *      case ScrollManager.ScrollDirection.PREV:
                 *
                 *          list = objScrollElementsList.objList;
                 *          if (objScrollElementsList.selectedElement.Equals(0))
                 *          {
                 *
                 *              IdDoc = ((SAAdminTool.DocsPaWR.infoToDoList) (list[7])).sysIdDoc;
                 *              IdFasc = ((SAAdminTool.DocsPaWR.infoToDoList) (list[7])).sysIdFasc;
                 *          }
                 *          else
                 *          {
                 *              IdDoc = ((SAAdminTool.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement-1])).sysIdDoc;
                 *              IdFasc = ((SAAdminTool.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement-1])).sysIdFasc;
                 *          }
                 *          if (string.IsNullOrEmpty(IdDoc))
                 *          {
                 *              whatisit = "F";
                 *              objScrollElementsList.searchContext =
                 *                  ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST;
                 *          }
                 *          else if(string.IsNullOrEmpty(IdFasc))
                 *          {
                 *              whatisit = "D";
                 *              objScrollElementsList.searchContext =
                 *                  ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST;
                 *          }
                 *          break;
                 *
                 *  }
                 */

                //Verifico che tipo di lista devo scorrere
                switch (objScrollElementsList.searchContext)
                {
                case ObjScrollElementsList.EmunSearchContext.RICERCA_DOCUMENTI:
                case ObjScrollElementsList.EmunSearchContext.RICERCA_DOC_IN_FASC:
                    scrollManager = new ScrollManagerDoc();
                    script        = scrollManager.move(objScrollElementsList, this.Page, scrollDirection);
                    break;

                case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC_TO_DO_LIST:
                    scrollManager = new ScrollManagerTrasm();
                    script        = scrollManager.move(objScrollElementsList, this.Page, scrollDirection);
                    break;

                case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_DOC:
                case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC_TO_DO_LIST:
                    scrollManager = new ScrollManagerTrasm();
                    script        = scrollManager.move(objScrollElementsList, this.Page, scrollDirection);
                    break;

                case ObjScrollElementsList.EmunSearchContext.RICERCA_TRASM_FASC:
                    scrollManager = new ScrollManagerTrasm();
                    script        = scrollManager.move(objScrollElementsList, this.Page, scrollDirection);
                    break;

                case ObjScrollElementsList.EmunSearchContext.RICERCA_FASCICOLI:
                    scrollManager = new ScrollManagerFasc();
                    script        = scrollManager.move(objScrollElementsList, this.Page, scrollDirection);
                    break;
                }

                //Registro lo script per chiamare la pagina del nuovo elemento
                if (!string.IsNullOrEmpty(script))
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "pageDocument", script, true);
                }
            }
        }