Exemple #1
0
        public ActionResult ShowTab(Tab idTab)
        {
            logger.Info("begin");
            logger.Info("tab to change: " + idTab);
            MainModelCommand command = null;

            if (idTab == Tab.TODO_LIST)
            {
                NavigationHandler.AdlMemento     = null;
                NavigationHandler.RicercaMemento = null;

                //if (NavigationHandler.Model.PreviousTabName != "TODO_LIST" && NavigationHandler.Model.PreviousTabName != "DETTAGLIO_DOC")
                //    NavigationHandler.ToDoListMemento = null;

                //if (
                //    (NavigationHandler.Model.PreviousTabName == "DETTAGLIO_DOC" && NavigationHandler.Model.PreviousTabName2 == "TODO_LIST")
                //    /*|| (NavigationHandler.Model.PreviousTabName == "TODO_LIST" && NavigationHandler.Model.PreviousTabName != "DETTAGLIO_DOC")*/
                //    )
                //    NavigationHandler.ToDoListMemento = null;

                command = new ToDoListCommand();
            }
            if (idTab == Tab.RICERCA)
            {
                //NavigationHandler.ToDoListMemento = null;
                NavigationHandler.AdlMemento = null;

                //if (NavigationHandler.Model.PreviousTabName!="RICERCA")
                //    NavigationHandler.RicercaMemento = null;

                if (NavigationHandler.Model.PreviousTabName != "RICERCA" && NavigationHandler.Model.PreviousTabName != "DETTAGLIO_DOC")
                {
                    NavigationHandler.RicercaMemento = null;
                }

                if (
                    !((NavigationHandler.Model.PreviousTabName == "RICERCA" || NavigationHandler.Model.PreviousTabName == "DETTAGLIO_DOC") && (NavigationHandler.Model.PreviousTabName2 == "RICERCA" || NavigationHandler.Model.PreviousTabName2 == "DETTAGLIO_DOC")) ||
                    (NavigationHandler.Model.PreviousTabName == "RICERCA" && !(NavigationHandler.Model.PreviousTabName2 == "DETTAGLIO_DOC" || NavigationHandler.Model.PreviousTabName2 == "RICERCA"))
                    )
                {
                    NavigationHandler.RicercaMemento = null;
                }

                command = new RicercaCommand();
            }
            if (idTab == Tab.AREA_DI_LAVORO)
            {
                //NavigationHandler.ToDoListMemento = null;
                NavigationHandler.RicercaMemento = null;

                //if (NavigationHandler.Model.PreviousTabName != "AREA_DI_LAVORO")
                //    NavigationHandler.AdlMemento = null;

                if (NavigationHandler.Model.PreviousTabName != "AREA_DI_LAVORO" && NavigationHandler.Model.PreviousTabName != "DETTAGLIO_DOC")
                {
                    NavigationHandler.AdlMemento = null;
                }

                if (
                    !((NavigationHandler.Model.PreviousTabName == "AREA_DI_LAVORO" || NavigationHandler.Model.PreviousTabName == "DETTAGLIO_DOC") && (NavigationHandler.Model.PreviousTabName2 == "AREA_DI_LAVORO" || NavigationHandler.Model.PreviousTabName2 == "DETTAGLIO_DOC")) ||
                    (NavigationHandler.Model.PreviousTabName == "AREA_DI_LAVORO" && !(NavigationHandler.Model.PreviousTabName2 == "DETTAGLIO_DOC" || NavigationHandler.Model.PreviousTabName2 == "AREA_DI_LAVORO"))
                    )
                {
                    NavigationHandler.AdlMemento = null;
                }

                command = new AdlCommand();
            }
            if (idTab == Tab.LISTA_DELEGHE)
            {
                NavigationHandler.AdlMemento     = null;
                NavigationHandler.RicercaMemento = null;
                //NavigationHandler.ToDoListMemento = null;

                command = new ListaDelegheCommand();
            }

            if (idTab == Tab.SMISTAMENTO)
            {
                NavigationHandler.AdlMemento     = null;
                NavigationHandler.RicercaMemento = null;
                //NavigationHandler.ToDoListMemento = null;

                command = new SmistamentoFormCommand();
            }

            if (idTab == Tab.LIBRO_FIRMA)
            {
                NavigationHandler.AdlMemento     = null;
                NavigationHandler.RicercaMemento = null;

                command = new LibroFirmaCommand();
            }

            ActionResult res = CommandExecute(command);

            logger.Info("end");
            return(res);
        }
Exemple #2
0
        public ActionResult ShowAndResetTab(Tab idTab)
        {
            logger.Info("begin");
            logger.Info("tab to change: " + idTab);
            MainModelCommand command = null;

            if (idTab == Tab.TODO_LIST)
            {
                NavigationHandler.AdlMemento        = null;
                NavigationHandler.RicercaMemento    = null;
                NavigationHandler.ToDoListMemento   = null;
                NavigationHandler.LibroFirmaMemento = null;

                command = new ToDoListCommand();
            }
            if (idTab == Tab.RICERCA)
            {
                //NavigationHandler.ToDoListMemento = null;
                NavigationHandler.AdlMemento        = null;
                NavigationHandler.RicercaMemento    = null;
                NavigationHandler.LibroFirmaMemento = null;

                command = new RicercaCommand();
            }
            if (idTab == Tab.AREA_DI_LAVORO)
            {
                //NavigationHandler.ToDoListMemento = null;
                NavigationHandler.RicercaMemento    = null;
                NavigationHandler.AdlMemento        = null;
                NavigationHandler.LibroFirmaMemento = null;

                command = new AdlCommand();
            }
            if (idTab == Tab.LISTA_DELEGHE)
            {
                NavigationHandler.AdlMemento        = null;
                NavigationHandler.RicercaMemento    = null;
                NavigationHandler.LibroFirmaMemento = null;
                //NavigationHandler.ToDoListMemento = null;

                command = new ListaDelegheCommand();
            }

            if (idTab == Tab.SMISTAMENTO)
            {
                NavigationHandler.AdlMemento        = null;
                NavigationHandler.RicercaMemento    = null;
                NavigationHandler.LibroFirmaMemento = null;
                //NavigationHandler.ToDoListMemento = null;

                command = new SmistamentoFormCommand();
            }

            if (idTab == Tab.LIBRO_FIRMA)
            {
                NavigationHandler.AdlMemento     = null;
                NavigationHandler.RicercaMemento = null;
            }

            ActionResult res = CommandExecute(command);

            logger.Info("end");
            return(res);
        }