public CombinationsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher) { Combinations = baseLayer.DssDbContext.Combinations.Local; CombinationViewModels = new ObservableCollection<CombinationViewModel>(); ErrorCatcher = errorCatcher; foreach (var combination in Combinations) CombinationViewModels.Add(new CombinationViewModel(combination, this)); }
public EventDepActionViewModel(BaseLayer baseLayer, Event eventTemplate, EventsDepActionsViewModel eventsDepActionsViewModel, IErrorCatch errorCatcher) { this.Actions = baseLayer.DssDbContext.Actions.Local; this.EditableEvent = eventTemplate; base.ErrorCatcher = errorCatcher; this.EventsDepActionsViewModel = eventsDepActionsViewModel; AddEventCommand = new DelegateCommand<object>(this.OnAddEvent); }
public ActionsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher) { base.ErrorCatcher = errorCatcher; this.BaseLayer = baseLayer; this.Actions = this.BaseLayer.DssDbContext.Actions.Local; this.ActionViewModels = new ObservableCollection<ActionViewModel>(); foreach (var action in this.Actions) this.ActionViewModels.Add(new ActionViewModel(action, this, base.ErrorCatcher)); }
public EventsWithExtensionsViewModel(ObservableCollection<Event> events, BaseLayer baseLayer, IErrorCatch errorCatcher) { this.Events = events; base.ErrorCatcher = errorCatcher; this.BaseLayer = baseLayer; this.EventWithExtensionViewModels = new ObservableCollection<EventWithExtensionViewModel>(); this.ProbabilitySumViewModel = new ProbabilitySumViewModel(base.ErrorCatcher); foreach (var ev in this.Events) this.EventWithExtensionViewModels.Add(new EventWithExtensionViewModel(ev, this, base.ErrorCatcher)); }
public EventsWithExtensionsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher) { base.ErrorCatcher = errorCatcher; this.BaseLayer = baseLayer; this.Events = this.BaseLayer.DssDbContext.Events.Local; this.EventWithExtensionViewModels = new ObservableCollection<EventWithExtensionViewModel>(); this.ProbabilitySumViewModel = new ProbabilitySumViewModel(base.ErrorCatcher); foreach (var ev in this.Events) this.EventWithExtensionViewModels.Add(new EventWithExtensionViewModel(ev, this, base.ErrorCatcher)); }
public Load(Task task) { BaseLayer = new BaseLayer(); dssDbContext = new DssDbEntities(); Task = task; Combinations = (dssDbContext.Combinations.Where(c => c.TaskId == task.Id)).ToList(); if (Combinations.Count != 0) { Actions = (Combinations.Select(c => c.Action)).Distinct().ToList(); var nullableCombinations = Combinations.Where(combination => combination.Event == null).ToList(); foreach (var nullableCombination in nullableCombinations) { Combinations.Remove(nullableCombination); } Events = (Combinations.Select(c => c.Event)).Distinct().ToList(); } else { Actions = (dssDbContext.Actions.Where(a => a.SavingId == task.SavingId)).ToList(); Events = (dssDbContext.Events.Where(ev => ev.SavingId == task.SavingId)).ToList(); } }
protected List<Combination> GetLastCombinations(BaseLayer baseLayer) { return baseLayer.DssDbContext.Combinations.Local.ToList(); }
// Метод вызывающий запуск приложения с главного окна public void Show(object pageAction, string title, string taskuniq, BaseLayer baseLayer) { WindowTitle = title; if (baseLayer == null) { BaseLayer = new BaseLayer(); BaseLayer.Task.TaskUniq = taskuniq; CreateTaskParamsTemplate(); } else BaseLayer = baseLayer; BaseLayer.Task.SavingId = SavingID; InitViewModels(); ShowPageMain(); }
public EventsDepActionsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher) { this.BaseLayer = baseLayer; base.ErrorCatcher = errorCatcher; InitEventsDependingActions(); }
public TaskParamsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher) { this.Task = baseLayer.Task; ErrorCatcher = errorCatcher; }