Exemple #1
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);
                }
            }
        }
Exemple #2
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 = "";
            }
        }
Exemple #3
0
        public void FillItem()
        {
            if (Action == null)
            {
                Action = new TransformationTreeItem(false);
            }
            Action.name = this.NameTextBox.Text.Trim();

            Action.Instruction = this.InstructionsPanel.Fill();
            Action.conditions  = TransformationTreeService.getInstructionString(Action.Instruction);
            //BlockPanel.Loops = null;
            //BlockPanel.TransformationTables = null;
            //BlockPanel.TransformationSlides = null;
        }
Exemple #4
0
 public TransformationTreeService GetTransformationTreeService()
 {
     if (transformationTreeService == null)
     {
         transformationTreeService = new TransformationTreeService();
         transformationTreeService.ResourcePath             = ResourcePath.TRANSFORMATION_TREE_RESOURCE_PATH;
         transformationTreeService.SocketResourcePath       = ResourcePath.SOCKET_TRANSFORMATION_TREE_RESOURCE_PATH;
         transformationTreeService.FileService              = GetFileService();
         transformationTreeService.ModelService             = GetModelService();
         transformationTreeService.MeasureService           = GetMeasureService();
         transformationTreeService.CalculatedMeasureService = GetCalculatedMeasureService2();
         transformationTreeService.TargetService            = GetTargetService();
         transformationTreeService.PeriodicityService       = GetPeriodicityService();
         transformationTreeService.PeriodNameService        = GetPeriodNameService();
         configureService(transformationTreeService);
     }
     return(transformationTreeService);
 }
Exemple #5
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);
        }