Ejemplo n.º 1
0
        public void Handle(WizardEvent <BudgetEquationWizardVM> message)
        {
            if (EquationToEdit != null && message.Status == WizardStatus.OK)
            {
                SuppressEvent = true;
                SaveEquation(message.Model.Equation);
                var equation = Equations.FirstOrDefault(x => x.Id == message.Model.Equation.Id);
                if (equation != null)
                {
                    equation.Name      = message.Model.Equation.Name;
                    equation.IsVisible = message.Model.Equation.IsVisible;
                    equation.Items.Clear();
                    equation.Items.AddRange(message.Model.Equation.Items);
                    BudgetCalculatorEvaluator.Refresh(equation);
                    equation.Refresh();
                }
                else
                {
                    Equations.Add(message.Model.Equation);
                }

                BudgetCalculatorEvaluator.Refresh(message.Model.Equation);
                SuppressEvent = false;
            }
        }
Ejemplo n.º 2
0
 private void RefreshCalculations()
 {
     if (BudgetCalculatorEvaluator != null && Equation != null)
     {
         BudgetCalculatorEvaluator.Refresh(Equation);
     }
 }
Ejemplo n.º 3
0
        public void LoadData(Budget budget)
        {
            BudgetCalculatorEvaluator.Budget = budget;
            LoadValueTypes();
            LoadOperatorTypes();
            Budget = budget;
            if (Database.Count <BudgetCalculatorEquation>() > 0)
            {
                LastEquationPosition = Database.ExecuteScalar <int>("SELECT MAX(Position) FROM [BudgetCalculatorEquation]");
            }
            var equations = CachedService.GetAllEquations();

            equations.ForEach(x =>
            {
                BudgetCalculatorEvaluator.Refresh(x);
            });

            Equations.IsNotifying = false;
            Equations.Clear();
            Equations.AddRange(equations);
            Equations.IsNotifying = true;
            Equations.Refresh();
        }