aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs36
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj31
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionsTypesViewVM.cs)4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs59
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml31
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml25
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs32
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml45
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs34
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml31
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs30
13 files changed, 394 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs
new file mode 100644
index 000000000..4673d12b2
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EventTypeActionsToStringConverter.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using Tango.DAL.Observables;
+using Tango.MachineStudio.DB.ViewModels;
+
+namespace Tango.MachineStudio.DB.Converters
+{
+ public class EventTypeActionsToStringConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null) return "";
+
+ if (value is IEnumerable<EventTypesAction>)
+ {
+ IEnumerable<EventTypesAction> eventActions = value as IEnumerable<EventTypesAction>;
+ return String.Join(", ", eventActions.Where(x => !x.Deleted).Select(x => x.ActionTypes.Name));
+ }
+ else
+ {
+ IEnumerable<MultiComboVM<ActionType>> eventActions = value as IEnumerable<MultiComboVM<ActionType>>;
+ return String.Join(", ", eventActions.Where(x => x.IsSelected).Select(x => x.Entity.Name));
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
index 62503d47e..b77d0daf9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
@@ -87,12 +87,13 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="Converters\EventTypeActionsToStringConverter.cs" />
<Compile Include="Converters\RolesPermissionsToStringConverter.cs" />
<Compile Include="DBModule.cs" />
<Compile Include="ExtensionMethods\INotificationProviderExtensions.cs" />
<Compile Include="Messages\CloseEntityEditViewMessage.cs" />
<Compile Include="Messages\OpenEntityEditViewMessage.cs" />
- <Compile Include="ViewModels\ActionsTypesViewVM.cs" />
+ <Compile Include="ViewModels\ActionTypesViewVM.cs" />
<Compile Include="ViewModels\AddressesViewVM.cs" />
<Compile Include="ViewModels\ApplicationDisplayPanelVersionsViewVM.cs" />
<Compile Include="ViewModels\ApplicationFirmwareVersionsViewVM.cs" />
@@ -121,6 +122,12 @@
<Compile Include="ViewModels\EntityViewModel.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModelLocator.cs" />
+ <Compile Include="Views\DBViews\ActionTypesView.xaml.cs">
+ <DependentUpon>ActionTypesView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\DBViews\ActionTypeView.xaml.cs">
+ <DependentUpon>ActionTypeView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\IdsPacksView.xaml.cs">
<DependentUpon>IdsPacksView.xaml</DependentUpon>
</Compile>
@@ -241,9 +248,15 @@
<Compile Include="Views\DBViews\OrganizationView.xaml.cs">
<DependentUpon>OrganizationView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\EventTypesView.xaml.cs">
+ <DependentUpon>EventTypesView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\UsersView.xaml.cs">
<DependentUpon>UsersView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\EventTypeView.xaml.cs">
+ <DependentUpon>EventTypeView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\UserView.xaml.cs">
<DependentUpon>UserView.xaml</DependentUpon>
</Compile>
@@ -268,6 +281,14 @@
<Compile Include="CustomAttributes\DBViewAttribute.cs" />
<Compile Include="Managers\RegisteredView.cs" />
<Compile Include="Managers\ViewsManager.cs" />
+ <Page Include="Views\DBViews\ActionTypesView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Views\DBViews\ActionTypeView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\IdsPacksView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -428,10 +449,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\EventTypesView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\UsersView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\EventTypeView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\UserView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
index e8a84f1b2..8bc6ff1c0 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
@@ -41,6 +41,9 @@ namespace Tango.MachineStudio.DB
SimpleIoc.Default.Register<LiquidTypesViewVM>();
SimpleIoc.Default.Register<CartridgesViewVM>();
SimpleIoc.Default.Register<CartridgeTypesViewVM>();
+
+ SimpleIoc.Default.Register<EventTypesViewVM>();
+ SimpleIoc.Default.Register<ActionTypesViewVM>();
}
public static MainViewVM MainViewVM
@@ -226,5 +229,13 @@ namespace Tango.MachineStudio.DB
return ServiceLocator.Current.GetInstance<EventTypesViewVM>();
}
}
+
+ public static ActionTypesViewVM ActionTypesViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<ActionTypesViewVM>();
+ }
+ }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionsTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs
index c627ffbc4..fe9ebda26 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionsTypesViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ActionTypesViewVM.cs
@@ -8,9 +8,9 @@ using Tango.MachineStudio.Common.Notifications;
namespace Tango.MachineStudio.DB.ViewModels
{
- public class ActionsTypesViewVM : DbTableViewModel<ActionType>
+ public class ActionTypesViewVM : DbTableViewModel<ActionType>
{
- public ActionsTypesViewVM(INotificationProvider notification) : base(notification)
+ public ActionTypesViewVM(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
index 442eac908..69e3c9ff6 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/EventTypesViewVM.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -12,6 +13,64 @@ namespace Tango.MachineStudio.DB.ViewModels
{
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.ActionTypes == actionType.Entity && !x.Deleted))
+ {
+ 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);
+
+ foreach (var actionType in SelectedActions)
+ {
+ var userRole = eventType.EventTypesActions.SingleOrDefault(x => x.ActionTypes == actionType.Entity);
+
+ if (userRole != null)
+ {
+ userRole.Deleted = !actionType.IsSelected;
+ }
+ else
+ {
+ if (actionType.IsSelected)
+ {
+ eventType.EventTypesActions.Add(new EventTypesAction()
+ {
+ ActionTypes = actionType.Entity,
+ EventTypes = eventType,
+ ActionTypeGuid = actionType.Entity.Guid,
+ EventTypeGuid = eventType.Guid
+ });
+ }
+ }
+ }
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml
new file mode 100644
index 000000000..11a472edb
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml
@@ -0,0 +1,31 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ActionTypeView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels"
+ xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
+ mc:Ignorable="d"
+ d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:ActionTypesViewVM, IsDesignTimeCreatable=False}">
+
+ <Grid>
+ <controls:TableGrid>
+ <TextBlock Text="ID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Code:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Description:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox>
+ </controls:TableGrid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs
new file mode 100644
index 000000000..05a56fb89
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypeView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachineView.xaml
+ /// </summary>
+ public partial class ActionTypeView : UserControl
+ {
+ public ActionTypeView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml
new file mode 100644
index 000000000..a9a14fb0c
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml
@@ -0,0 +1,25 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.ActionTypesView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:global="clr-namespace:Tango.MachineStudio.DB"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ActionTypesViewVM}">
+ <Grid>
+ <controls:DbTableView>
+ <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ActionTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True">
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn>
+ <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Description" Binding="{Binding Description}"></DataGridTextColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </controls:DbTableView>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs
new file mode 100644
index 000000000..aad79c87a
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ActionTypesView.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.MachineStudio.DB.CustomAttributes;
+using Tango.MachineStudio.DB.Managers;
+using Tango.SharedUI.Controls;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachinesView.xaml
+ /// </summary>
+ [DBView]
+ public partial class ActionTypesView : UserControl
+ {
+ public ActionTypesView() : base()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml
new file mode 100644
index 000000000..4bbc741f0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml
@@ -0,0 +1,45 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EventTypeView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters"
+ xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="300">
+
+ <UserControl.Resources>
+ <converters:EventTypeActionsToStringConverter x:Key="EventTypeActionsToStringConverter"></converters:EventTypeActionsToStringConverter>
+ </UserControl.Resources>
+
+ <Grid>
+ <controls:TableGrid>
+ <TextBlock Text="ID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True" IsEnabled="False"></TextBox>
+ <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True" IsEnabled="False"></TextBox>
+ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True" IsEnabled="False"></TextBox>
+ <TextBlock Text="Code:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Description:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Actions:" FontWeight="Bold"></TextBlock>
+ <ComboBox x:Name="comboActions" SelectionChanged="comboRoles_SelectionChanged" ItemsSource="{Binding SelectedActions}" materialDesign:HintAssist.Hint="{Binding SelectedActions,Converter={StaticResource EventTypeActionsToStringConverter},UpdateSourceTrigger=PropertyChanged}">
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal">
+ <CheckBox IsChecked="{Binding IsSelected}" Width="20"/>
+ <TextBlock Text="{Binding Entity.Name}" MinWidth="100" />
+ </StackPanel>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </controls:TableGrid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs
new file mode 100644
index 000000000..6294b14e7
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypeView.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for UserView.xaml
+ /// </summary>
+ public partial class EventTypeView : UserControl
+ {
+ public EventTypeView()
+ {
+ InitializeComponent();
+ }
+
+ private void comboRoles_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ comboActions.SelectedItem = null;
+ comboActions.Text = "Press to select";
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml
new file mode 100644
index 000000000..bb8f6e514
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml
@@ -0,0 +1,31 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.EventTypesView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:global="clr-namespace:Tango.MachineStudio.DB"
+ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EventTypesViewVM}">
+
+ <UserControl.Resources>
+ <converters:EventTypeActionsToStringConverter x:Key="EventTypeActionsToStringConverter"></converters:EventTypeActionsToStringConverter>
+ </UserControl.Resources>
+
+ <Grid>
+ <controls:DbTableView>
+ <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EventTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True">
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn>
+ <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Description" Binding="{Binding Description}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Actions" Binding="{Binding EventTypesActions,Converter={StaticResource EventTypeActionsToStringConverter}}"></DataGridTextColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </controls:DbTableView>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs
new file mode 100644
index 000000000..3c197b7f2
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EventTypesView.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.MachineStudio.DB.CustomAttributes;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for UsersView.xaml
+ /// </summary>
+ [DBView]
+ public partial class EventTypesView : UserControl
+ {
+ public EventTypesView()
+ {
+ InitializeComponent();
+ }
+ }
+}