Exemple #1
0
        /// <summary>
        /// Open the Search view for a functionality in creation mode
        /// </summary>
        /// <param name="token">NavigationToken</param>
        protected OperationState openSearchPage(NavigationToken token)
        {
            String       functionality = token.Functionality;
            Controllable page          = searchInOpenedPages(functionality);

            if (page == null)
            {
                page = ApplicationManager.ControllerFactory.GetController(functionality, token.ViewType, token.EditionMode);
                if (page == null)
                {
                    return(openHomePage());
                }
                OpenedPages.Add(page);
                page.NavigationToken = token;
                page.Initialize();
            }
            openPage(page);
            page.Search();

            if (token.ItemId != null)
            {
                int idmodel = int.Parse(token.ItemId.ToString());
                page.Search(idmodel);
            }
            return(OperationState.CONTINUE);
        }
Exemple #2
0
        /// <summary>
        /// Open Home page
        /// </summary>
        public OperationState openHomePage()
        {
            Controllable homePage = searchInOpenedPages(FunctionalitiesCode.HOME_PAGE);

            if (homePage == null)
            {
                homePage = ApplicationManager.ControllerFactory.GetController(FunctionalitiesCode.HOME_PAGE);
                homePage.Initialize();
            }
            return(openPage(homePage));
        }
Exemple #3
0
        /// <summary>
        /// Open a Edition view for a fonctionality
        /// This method shall be called by the PageManager
        /// </summary>
        /// <param name="token">NavigationToken</param>
        protected OperationState openEditionPage(NavigationToken token)
        {
            Controllable page = null;

            try
            {
                String functionality = token.Functionality;

                if (functionality == FunctionalitiesCode.FILE_SAVE)
                {
                    return(saveFile(token));
                }

                page = searchInOpenedPages(functionality);

                if (page == null)
                {
                    page = ApplicationManager.ControllerFactory.GetController(functionality, token.ViewType, token.EditionMode);
                    if (page == null)
                    {
                        return(openHomePage());
                    }
                    OpenedPages.Add(page);
                    page.NavigationToken = token;
                    page.Initialize();
                }
                openPage(page);
                EditionMode editionMode = token.EditionMode;
                object      oid         = token.ItemId;
                if (editionMode == EditionMode.CREATE)
                {
                    page.Create();
                }
                else if (editionMode == EditionMode.READ_ONLY)
                {
                    if (token.ItemIds.Count == 0)
                    {
                        page.Open(oid);
                    }

                    foreach (object id in token.ItemIds)
                    {
                        if (id != null)
                        {
                            page.Open(id);
                        }
                    }
                }
                else if (editionMode == EditionMode.MODIFY)
                {
                    if (token.ItemIds.Count == 0)
                    {
                        page.Edit(oid);
                    }
                    foreach (object id in token.ItemIds)
                    {
                        if (id != null)
                        {
                            page.Edit(id);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                InternalErrorMessage = ex.Message;
                OnClosePage(page);
            }
            return(OperationState.CONTINUE);
        }
Exemple #4
0
        public void displayReportView(int reportoid = 0, int treeOid = -1)
        {
            if (slideDialog == null)
            {
                return;
            }
            TreeActionDialog.IsActionReportView = false;
            slideDialog.IsReportView            = true;
            PresentationEditorItem page = (PresentationEditorItem)getPresentationEditor().getActivePage();

            if (page == null)
            {
                return;
            }

            NavigationToken token = NavigationToken.GetCreateViewToken(Reporting.Base.ReportingFunctionalitiesCode.REPORT_EDIT);

            if (reportoid > 0)
            {
                token = NavigationToken.GetModifyViewToken(Reporting.Base.ReportingFunctionalitiesCode.REPORT_EDIT, reportoid);
            }

            controllable = ApplicationManager.ControllerFactory.GetController(token.Functionality, token.ViewType, token.EditionMode);
            controllable.NavigationToken = token;
            controllable.Initialize();

            ReportEditorController controller = (ReportEditorController)controllable;

            controller.getInputTableEditor().NewPageSelected -= controller.NewPageSelectedHandler;
            controller.getInputTableEditor().OnRemoveNewPage += OnRemoveNewReportPage;
            controller.listeTotalReport = BlockPanel.listeTotalReport;


            TreeLoopGroup LoopGroup = ((ReportSideBar)controller.SideBar).TreeLoopGroup;

            controller.SideBar.RemoveGroup(((ReportSideBar)controller.SideBar).StatusGroup);
            controller.SideBar.RemoveGroup(0);
            if (LoopGroup != null)
            {
                LoopGroup.TransformationTreeLoopTreeview.fillTree(this.Loops);
                controller.SideBar.AddGroup(LoopGroup, 0);
            }

            controller.CustomizeMenuForTree(slideDialog.dockingManager);
            slideDialog.displaySideBar(controller.SideBar);
            slideDialog.displayPropertyBar(controller.PropertyBar);
            slideDialog.displayView(controller.View);

            controller.treeOid = treeOid;
            if (reportoid > 0)
            {
                controller.Open(reportoid);
                if (slideDialog != null)
                {
                    slideDialog.SaveButton.IsEnabled = false;
                }
            }
            else
            {
                controller.Create();
                if (slideDialog != null)
                {
                    slideDialog.SaveButton.IsEnabled = true;
                }
            }
            controller.ChangeEventListener += onChange;
        }