Exemple #1
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
        }
Exemple #2
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);

            }
        }