예제 #1
0
        /// <summary>
        /// Retourne une nouvelle page.
        /// </summary>
        /// <returns>Une nouvelle instance de EditorItem</returns>
        protected override EditorItem <LinkedAttributeGrid> getNewPage()
        {
            LinkedAttributeGridEditorItem item = new LinkedAttributeGridEditorItem(this.SubjectType);

            item.getLinkedAttributeGridForm().Grid.Service = this.Service.InputGridService;
            return(item);
        }
        public virtual void Search(int currentPage = 0)
        {
            LinkedAttributeGridEditorItem page = (LinkedAttributeGridEditorItem)getEditor().getActivePage();

            try
            {
                GrilleFilter filter = page.getLinkedAttributeGridForm().FillFilter();
                filter.attribute = page.EditedObject.attribute;
                filter.grid      = new Grille();
                //filter.grid.code = page.EditedObject.code;
                filter.grid.columnListChangeHandler = page.EditedObject.columnListChangeHandler;
                filter.grid.report = page.EditedObject.report;
                filter.grid.oid    = page.EditedObject.oid;
                filter.grid.name   = page.EditedObject.name;
                filter.page        = currentPage;
                filter.pageSize    = (int)page.getLinkedAttributeGridForm().Toolbar.pageSizeComboBox.SelectedItem;
                filter.showAll     = page.getLinkedAttributeGridForm().Toolbar.showAllCheckBox.IsChecked.Value;
                GrillePage rows = this.GetLinkedAttributeGridService().getGridRows(filter);
                page.getLinkedAttributeGridForm().DisplayPage(rows);
            }
            catch (ServiceExecption)
            {
                GrillePage rows = new GrillePage();
                rows.rows = new List <object[]>(0);
                page.getLinkedAttributeGridForm().DisplayPage(rows);
            }
        }
        /// <summary>
        /// Initialisation des Handlers sur une nouvelle page.
        /// En plus des handlers de base, on initialise les handlers sur :
        /// - DesignerPropertiesPanel
        /// -
        /// - SpreadSheet
        /// -
        /// </summary>
        protected override void initializePageHandlers(EditorItem <LinkedAttributeGrid> page)
        {
            base.initializePageHandlers(page);
            LinkedAttributeGridEditorItem editorPage = (LinkedAttributeGridEditorItem)page;

            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.groupField.GroupService = GetInputGridService().GroupService;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.groupField.subjectType = SubjectTypeFound();
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.NameTextBox.KeyUp += onNameTextChange;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.NameTextBox.LostFocus += onNameTextLostFocus;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.groupField.Changed += onGroupFieldChange;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.OnSetTableVisible += OnSetTableVisible;

            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.visibleInShortcutCheckbox.Checked += OnVisibleInShortcutCheck;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.visibleInShortcutCheckbox.Unchecked += OnVisibleInShortcutCheck;

            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.Changed += OnInputGridPropertiesChange;
            //editorPage.getInputGridForm().InputGridSheetForm.InputGridPropertiesPanel.selectionColumnChanged += OnInputGridPropertiesSelectionColumnChange;

            if (editorPage.getLinkedAttributeGridForm().AdministrationBar != null)
            {
                editorPage.getLinkedAttributeGridForm().AdministrationBar.Changed += OnChangeEventHandler;
            }

            initializeGridFormHandlers(editorPage.getLinkedAttributeGridForm());
        }
        public override OperationState Open(LinkedAttributeGrid grid)
        {
            //if (getEditor().getPage(grid) == null) grid.loadGrilleFilter();
            LinkedAttributeGridEditorItem page = (LinkedAttributeGridEditorItem)getEditor().addOrSelectPage(grid);

            //UpdateStatusBar();
            //UpdateToolBar(page.EditedObject);
            initializePageHandlers(page);
            getEditor().ListChangeHandler.AddNew(grid);
            Search();
            return(OperationState.CONTINUE);
        }
        private void OnDeleteRows(object obj)
        {
            String message = "You are about to delete " + ((List <long>)obj).Count + " row(s).\nDo you want to continue?";

            if (MessageDisplayer.DisplayYesNoQuestion("Delete", message) == MessageBoxResult.Yes)
            {
                LinkedAttributeGridEditorItem page = (LinkedAttributeGridEditorItem)getEditor().getActivePage();
                if (this.GetLinkedAttributeGridService().deleteRows(page.EditedObject.oid.Value, (List <long>)obj))
                {
                    Search(page.getLinkedAttributeGridForm().Toolbar.current);
                }
            }
        }