Ejemplo n.º 1
0
        //public static void setInSessionObjScrollElementsList(ObjScrollElementsList objScrollElementsList)
        //{
        //    System.Web.HttpContext.Current.Session.Remove("ObjScrollElementsList");
        //    System.Web.HttpContext.Current.Session.Add("ObjScrollElementsList", objScrollElementsList);
        //}

        //public static void setInSessionNewObjScrollElementsList(int totalNumberOfElements, int totalNumberOfPage, int pageSize, int selectedElement, int selectedPage, ArrayList objList, ObjScrollElementsList.EmunSearchContext searchContext)
        //{
        //    ObjScrollElementsList objScrollElementsList = new ObjScrollElementsList();
        //    objScrollElementsList.totalNumberOfElements = totalNumberOfElements;
        //    objScrollElementsList.totalNumberOfPage = totalNumberOfPage;
        //    objScrollElementsList.pageSize = pageSize;
        //    objScrollElementsList.selectedElement = selectedElement;
        //    objScrollElementsList.selectedPage = selectedPage;
        //    objScrollElementsList.objList = objList;
        //    objScrollElementsList.searchContext = searchContext;

        //    System.Web.HttpContext.Current.Session.Add("ObjScrollElementsList", objScrollElementsList);
        //}

        //public static ObjScrollElementsList getFromSessionObjScrollElementsList()
        //{
        //    if (System.Web.HttpContext.Current.Session["ObjScrollElementsList"] != null)
        //    {
        //        ObjScrollElementsList objScrollElementsList = (ObjScrollElementsList)System.Web.HttpContext.Current.Session["ObjScrollElementsList"];
        //        return objScrollElementsList;
        //    }

        //    return null;
        //}

        //public static void clearSessionObjScrollElementsList()
        //{
        //    System.Web.HttpContext.Current.Session.Remove("ObjScrollElementsList");
        //}
        #endregion

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

            DocsPAWA.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 = (DocsPAWA.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 = (DocsPAWA.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.º 3
0
        private string moveTrasmNotInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            DocsPAWA.DocsPaWR.Trasmissione[] listaTram = null;
            DocsPAWA.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.º 4
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.º 5
0
        private string moveToDoListNotInPage(ObjScrollElementsList objScrollElementsList, Page page, ScrollManager.ScrollDirection scrollDirection)
        {
            string script = string.Empty;

            DocsPAWA.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
                    DocsPAWA.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), (DocsPAWA.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
                    DocsPAWA.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), (DocsPAWA.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.º 6
0
        private string moveDocInPage(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["docIndex"] = objScrollElementsList.selectedElement.ToString();
                }
                if (scrollDirection == ScrollManager.ScrollDirection.PREV)
                {
                    objScrollElementsList.selectedElement--;
                    SiteNavigation.CallContextStack.CallerContext.QueryStringParameters["docIndex"] = objScrollElementsList.selectedElement.ToString();
                }
            }

            if (objScrollElementsList.objList != null)
            {
                InfoDocumento newDoc = null;
                string        tipo   = objScrollElementsList.objList[objScrollElementsList.selectedElement].GetType().Name;

                if (tipo.Equals("SearchObject"))
                {
                    DocsPaWR.SearchObject doc = (DocsPaWR.SearchObject)objScrollElementsList.objList[objScrollElementsList.selectedElement];
                    newDoc = DocumentManager.GetInfoDocumento(doc.SearchObjectID, doc.SearchObjectID, page);
                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(newDoc, page);
                    }
                }
                else
                {
                    DocsPaWR.InfoDocumento doc = (DocsPaWR.InfoDocumento)objScrollElementsList.objList[objScrollElementsList.selectedElement];
                    newDoc = DocumentManager.GetInfoDocumento(doc.idProfile, doc.idProfile, page);
                    if (doc != null)
                    {
                        script = ScrollManager.refreshPage(newDoc, page);
                    }
                }
            }

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

            DocsPAWA.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), (DocsPAWA.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), (DocsPAWA.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.º 8
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)
                {
                    return(this.moveDocInPage(objScrollElementsList, page, scrollDirection));
                }

                //Siamo a fine pagina, va rifatta la ricerca e aggiornati i dati
                if (objScrollElementsList.selectedElement + 1 == objScrollElementsList.pageSize)
                {
                    return(this.moveDocNotInPage(objScrollElementsList, page, scrollDirection));
                }
            }

            //Mi muovo indietro
            if (scrollDirection == ScrollManager.ScrollDirection.PREV)
            {
                //Non siamo a inizio pagina, vanno aggiornati i dati
                if (objScrollElementsList.selectedElement != 0)
                {
                    return(this.moveDocInPage(objScrollElementsList, page, scrollDirection));
                }

                //Siamo a inizio pagina, va rifatta la ricerca e aggiornati i dati
                if (objScrollElementsList.selectedElement == 0)
                {
                    return(this.moveDocNotInPage(objScrollElementsList, page, scrollDirection));
                }
            }

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

            //Recupero le informazioni per effettuare una nuova ricerca
            DocsPAWA.DocsPaWR.SearchObject[] listaDoc = null;
            DocsPaWR.InfoDocumento           doc      = 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 la nuova ricerca
                    listaDoc = searchDoc(objScrollElementsList, page);
                    if (listaDoc != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaDoc);
                        string tipo = objScrollElementsList.objList[0].GetType().Name;

                        if (tipo.Equals("SearchObject"))
                        {
                            DocsPaWR.SearchObject Newdoc = (DocsPaWR.SearchObject)objScrollElementsList.objList[0];
                            doc = DocumentManager.GetInfoDocumento(Newdoc.SearchObjectID, Newdoc.SearchObjectID, page);
                        }
                        else
                        {
                            doc = (DocsPaWR.InfoDocumento)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 la nuova ricerca
                    listaDoc = searchDoc(objScrollElementsList, page);
                    if (listaDoc != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaDoc);
                        string tipo = objScrollElementsList.objList[0].GetType().Name;

                        if (tipo.Equals("SearchObject"))
                        {
                            DocsPaWR.SearchObject Newdoc = (DocsPaWR.SearchObject)objScrollElementsList.objList[objScrollElementsList.pageSize - 1];
                            doc = DocumentManager.GetInfoDocumento(Newdoc.SearchObjectID, Newdoc.SearchObjectID, page);
                        }
                        else
                        {
                            doc = (DocsPaWR.InfoDocumento)objScrollElementsList.objList[objScrollElementsList.pageSize - 1];
                        }
                    }
                }
            }

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

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

            //Recupero le informazioni per effettuare una nuova ricerca
            SAAdminTool.DocsPaWR.SearchObject[] listaFasc = null;
            SAAdminTool.DocsPaWR.SearchObject   fasc      = 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["fascIndex"] = "0";
                    SiteNavigation.CallContextStack.CallerContext.PageNumber = objScrollElementsList.selectedPage + 1;

                    //Effettuo la nuova ricerca
                    listaFasc = searchFasc(objScrollElementsList, page);
                    if (listaFasc != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaFasc);
                        fasc = (DocsPaWR.SearchObject)objScrollElementsList.objList[0];
                    }
                }

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

                    //Effettuo la nuova ricerca
                    listaFasc = searchFasc(objScrollElementsList, page);
                    if (listaFasc != null)
                    {
                        objScrollElementsList.objList = new ArrayList(listaFasc);
                        fasc = (DocsPaWR.SearchObject)objScrollElementsList.objList[objScrollElementsList.pageSize - 1];
                    }
                }
            }

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

            return(script);
        }
Ejemplo n.º 11
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.º 12
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 =
                                ((DocsPAWA.DocsPaWR.infoToDoList) (list[0])).
                                    sysIdDoc;
                            IdFasc = ((DocsPAWA.DocsPaWR.infoToDoList)(list[0])).sysIdFasc;
                        }
                        else
                        {
                            IdDoc =
                                ((DocsPAWA.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement + 1])).
                                    sysIdDoc;
                            IdFasc = ((DocsPAWA.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 = ((DocsPAWA.DocsPaWR.infoToDoList) (list[7])).sysIdDoc;
                            IdFasc = ((DocsPAWA.DocsPaWR.infoToDoList) (list[7])).sysIdFasc;
                        }
                        else
                        {
                            IdDoc = ((DocsPAWA.DocsPaWR.infoToDoList)(list[objScrollElementsList.selectedElement-1])).sysIdDoc;
                            IdFasc = ((DocsPAWA.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);

            }
        }