コード例 #1
0
 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));
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
ファイル: Load.cs プロジェクト: kstuDss/DecisionSupportSystem
 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();
     }
 }
コード例 #7
0
 protected List<Combination> GetLastCombinations(BaseLayer baseLayer)
 {
     return baseLayer.DssDbContext.Combinations.Local.ToList();
 }
コード例 #8
0
 // Метод вызывающий запуск приложения с главного окна
 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();
 }
コード例 #9
0
 public EventsDepActionsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher)
 {
     this.BaseLayer = baseLayer;
     base.ErrorCatcher = errorCatcher;
     InitEventsDependingActions();
 }
コード例 #10
0
 public TaskParamsViewModel(BaseLayer baseLayer, IErrorCatch errorCatcher)
 {
     this.Task = baseLayer.Task;
     ErrorCatcher = errorCatcher;
 }