예제 #1
0
        public IDependency CreateDependencyModel(IDependencyViewModel dependency)
        {
            switch (dependency)
            {
            case ConditionResultDependencyViewModel conditionResultDependencyViewModel:
                return(new ConditionResultDependency()
                {
                    Condition = _conditionFillHelper.CreateConditionFromViewModel(conditionResultDependencyViewModel.SelectedConditionViewModel),
                    Result = _resultFillHelper.CreateResultFromViewModel(conditionResultDependencyViewModel.SelectedResultViewModel)
                });

                break;
            }
            return(null);
        }
예제 #2
0
        public IFilter CreateFilter(IFilterViewModel filterViewModel)
        {
            switch (filterViewModel)
            {
            case FilterViewModel defaultFilterViewModel:
                var res = new DefaultFilter();
                res.Conditions = defaultFilterViewModel.ConditionViewModels
                                 .Select(model => _conditionFillHelper.CreateConditionFromViewModel(model))
                                 .Where(condition => condition != null)
                                 .ToList();
                res.Name = filterViewModel.Name;
                return(res);
            }

            return(null);
        }