diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-07 16:06:38 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-07 16:06:38 +0200 |
| commit | e111c33bc87acf40202f9e5423e21b087a366f07 (patch) | |
| tree | fac6d85ec3589620b1daea9a9f740a2120b0ca10 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels | |
| parent | 6da42fd28ffbb680d85bb9e695520713ff51022a (diff) | |
| download | Tango-e111c33bc87acf40202f9e5423e21b087a366f07.tar.gz Tango-e111c33bc87acf40202f9e5423e21b087a366f07.zip | |
Added new events !!!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels')
3 files changed, 0 insertions, 106 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs deleted file mode 100644 index 69092a70d..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.MachineStudio.Common.Notifications; - -namespace Tango.MachineStudio.DB.ViewModels -{ - public class ActionTypesViewVM : DbTableViewModel<ActionType> - { - public ActionTypesViewVM(INotificationProvider notification) : base(notification) - { - - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesGroupsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesGroupsViewVM.cs deleted file mode 100644 index abdb00e32..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesGroupsViewVM.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.MachineStudio.Common.Notifications; - -namespace Tango.MachineStudio.DB.ViewModels -{ - public class EventTypesGroupsViewVM : DbTableViewModel<EventTypesGroup> - { - public EventTypesGroupsViewVM(INotificationProvider notification) : base(notification) - { - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs deleted file mode 100644 index 6702b720f..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.MachineStudio.Common.Notifications; - -namespace Tango.MachineStudio.DB.ViewModels -{ - public class EventTypesViewVM : DbTableViewModel<EventType> - { - public EventTypesViewVM(INotificationProvider notification) : base(notification) - { - SelectedActions = new ObservableCollection<MultiComboVM<ActionType>>(); - } - - private ObservableCollection<MultiComboVM<ActionType>> _selectedActions; - public ObservableCollection<MultiComboVM<ActionType>> SelectedActions - { - get { return _selectedActions; } - set { _selectedActions = value; RaisePropertyChangedAuto(); } - } - - protected override void OnEdit() - { - SelectedActions = Adapter.ActionTypes.Select(x => new MultiComboVM<ActionType>(x, () => RaisePropertyChanged(nameof(SelectedActions)))).ToObservableCollection(); - - foreach (var actionType in SelectedActions) - { - if (SelectedEntity.EventTypesActions.ToList().Exists(x => x.ActionType == actionType.Entity)) - { - actionType.IsSelected = true; - } - } - - base.OnEdit(); - } - - protected override void OnAdd() - { - SelectedActions = Adapter.ActionTypes.Select(x => new MultiComboVM<ActionType>(x, () => RaisePropertyChanged(nameof(SelectedActions)))).ToObservableCollection(); - - base.OnAdd(); - } - - protected override void OnBeforeEntitySave(DialogOpenMode mode, EventType eventType) - { - base.OnBeforeEntitySave(mode, eventType); - - - - Adapter.Context.EventTypesActions.RemoveRange(eventType.EventTypesActions); - - foreach (var actionType in SelectedActions) - { - if (actionType.IsSelected) - { - eventType.EventTypesActions.Add(new EventTypesAction() - { - ActionType = actionType.Entity, - EventType = eventType, - ActionTypeGuid = actionType.Entity.Guid, - EventTypeGuid = eventType.Guid - }); - } - } - } - } -} |
