예제 #1
0
        protected void DisplayCondition()
        {
            this.ConditionPanel.Children.Clear();
            this.ConditionPanel.Children.Add(ConditionLabel);

            if (this.Loop.Instruction == null && String.IsNullOrWhiteSpace(this.Loop.conditions))
            {
                OnAddCondition(null);
                return;
            }
            if (this.Loop.Instruction == null && !String.IsNullOrWhiteSpace(this.Loop.conditions))
            {
                this.Loop.Instruction = TransformationTreeService.getInstructionObject(this.Loop.conditions);
            }
            foreach (Instruction child in this.Loop.Instruction.getIfInstruction().subInstructions)
            {
                foreach (ConditionItem item in child.conditionItems)
                {
                    this.ConditionPanel.Children.Add(GetNewExpressionPanel(item));
                }
            }
            if (this.ConditionPanel.Children.Count == 1)
            {
                OnAddCondition(null);
            }
            else
            {
                ExpressionPanel panel = (ExpressionPanel)this.ConditionPanel.Children[1];
                panel.OperatorComboBox.IsEnabled    = false;
                panel.OperatorComboBox.SelectedItem = "";
            }
        }
예제 #2
0
        protected void DisplayLoopCondition()
        {
            this.LoopConditionsPanel.Children.Clear();
            if (this.Loop.loopConditionsChangeHandler == null)
            {
                this.Loop.loopConditionsChangeHandler = new PersistentListChangeHandler <Kernel.Domain.LoopCondition>();
            }
            if (this.Loop.loopConditionsChangeHandler.Items.Count == 0)
            {
                OnAddConditionItem(null);
                return;
            }
            else
            {
                foreach (Kernel.Domain.LoopCondition condition in this.Loop.loopConditionsChangeHandler.Items)
                {
                    if (!string.IsNullOrEmpty(condition.conditions))
                    {
                        condition.instructions = TransformationTreeService.getInstructionObject(condition.conditions);
                    }
                    LoopConditionItemPanel panel = GetNewConditionItemPanel(condition);
                    if (condition.position == 0)
                    {
                        panel.OperatorComboBox.IsEnabled    = false;
                        panel.OperatorComboBox.SelectedItem = Operator.AND.ToString();
                    }

                    this.LoopConditionsPanel.Children.Add(panel);
                }
            }
        }
        public void DisplayCondition()
        {
            if (Loop == null)
            {
                Reset(); trow = true; return;
            }

            this.ConditionPanel.Children.Clear();
            //this.ConditionPanel.Children.Add(ConditionLabel);

            if (this.Loop.Instruction == null && String.IsNullOrWhiteSpace(this.Loop.conditions))
            {
                OnAddCondition(null);
                return;
            }
            if (Loop.loopConditionsChangeHandler.Items.Count == 0)
            {
            }
            if (this.Loop.Instruction == null && !String.IsNullOrWhiteSpace(this.Loop.conditions))
            {
                this.Loop.Instruction = TransformationTreeService.getInstructionObject(this.Loop.conditions);
            }
            foreach (Instruction child in this.Loop.Instruction.getIfInstruction().subInstructions)
            {
                foreach (ConditionItem item in child.conditionItems)
                {
                    this.ConditionPanel.Children.Add(GetNewExpressionPanel(item));
                }
            }
            //if (this.ConditionPanel.Children.Count == 1) OnAddCondition(null);
            //else
            //{
            //    ExpressionPanel panel = (ExpressionPanel)this.ConditionPanel.Children[1];
            //    panel.OperatorComboBox.IsEnabled = false;
            //    panel.OperatorComboBox.SelectedItem = "";
            //}
        }
예제 #4
0
        public void DisplayItem()
        {
            if (Action == null)
            {
                Reset(); return;
            }
            BlockPanel.Loops = this.loops;
            if (this.ReportEditorController == null)
            {
                this.initializeReport();
            }
            Report report = null;

            if (Action.reportOid.HasValue)
            {
                report = (Report)this.ReportEditorController.GetReportService().getByOid(Action.reportOid.Value);
                this.ReportEditorController.Open(report);
                SaveButton.IsEnabled = false;
            }
            else
            {
                if (this.ReportEditorController.getEditor().getPages().Count == 0)
                {
                    this.ReportEditorController.listeTotalReport = new ObservableCollection <Kernel.Domain.Browser.InputTableBrowserData>(this.ReportEditorController.GetReportService().getAllBrowserDatas());
                    this.ReportEditorController.Create();
                    this.ReportEditorController.listeTotalReport = null;
                    ReportEditorItem reportPage = (ReportEditorItem)this.ReportEditorController.getInputTableEditor().getActivePage();
                    if (reportPage != null)
                    {
                        report = (Report)reportPage.EditedObject;
                    }
                    SaveButton.IsEnabled = true;
                }

                ReportEditorItem page = (ReportEditorItem)this.ReportEditorController.getInputTableEditor().getActivePage();
                if (page != null)
                {
                    page.getReportForm().SpreadSheet.DeleteExcelSheet();
                    Range range = page.getReportForm().SpreadSheet.GetSelectedRange();

                    Cell activeCell = page.getReportForm().SpreadSheet.getActiveCell();
                    ApplicationManager.Instance.MainWindow.StatusLabel.Content = "";
                }
            }

            if (report != null && IsReadOnly)
            {
                this.ReportEditorController.getEditor().getActivePage().SetReadOnly(IsReadOnly);
            }

            BlockPanel.listeTotalReport = new ObservableCollection <Kernel.Domain.Browser.InputTableBrowserData>();

            BlockPanel.listeTotalReport.Add(new Kernel.Domain.Browser.InputTableBrowserData()
            {
                name     = report != null ? report.name : "",
                oid      = report != null && report.oid != null ? report.oid.Value : 0,
                isReport = true
            });
            this.NameTextBox.Text = Action.name;
            if (Action.Instruction == null && !String.IsNullOrWhiteSpace(Action.conditions))
            {
                Action.Instruction = TransformationTreeService.getInstructionObject(Action.conditions);
            }


            this.InstructionsPanel.Display(Action.Instruction);
        }