aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-13 15:19:55 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-13 15:19:55 +0200
commit2a51f05523c1397b77eca5e5188520919205638c (patch)
treeedc40c2ca201be6e881ea6746469fb5cb412e8bc /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent2c376ac3ae651dd6c6592cc4cbf72768dc97a93d (diff)
downloadTango-2a51f05523c1397b77eca5e5188520919205638c.tar.gz
Tango-2a51f05523c1397b77eca5e5188520919205638c.zip
Successfully separated Machine Studio to modules...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml41
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml.cs38
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/TableGrid.cs58
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Converters/UsersRolesToStringConverter.cs37
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/CustomAttributes/DBViewAttribute.cs12
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/DialogsManager.cs38
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/RegisteredView.cs54
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/ViewsManager.cs31
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs32
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml (renamed from Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml)0
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs (renamed from Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml.cs)0
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj98
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs41
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/AddressesViewVM.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DbTableViewModel.cs214
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DialogOpenMode.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MachinesViewVM.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MultiComboVM.cs44
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/OrganizationsViewVM.cs26
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/UsersViewVM.cs75
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/EntityViewModel.cs31
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml34
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml27
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml.cs31
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml25
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml.cs32
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml26
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml26
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml43
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml.cs34
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml27
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml19
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config2
41 files changed, 56 insertions, 1371 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
index 92aa00bf9..250f57a4d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
- <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
- </configSections>
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml
index f6f2da415..6974f54be 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml
@@ -2,7 +2,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Tango.MachineStudio.UI"
- xmlns:converters="clr-namespace:Tango.MachineStudio.UI.Converters"
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Application.Resources>
@@ -78,11 +77,6 @@
<ResourceDictionary>
<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</ResourceDictionary>
-
- <!--Binding Converters-->
- <ResourceDictionary>
- <converters:UsersRolesToStringConverter x:Key="UsersRolesToStringConverter"></converters:UsersRolesToStringConverter>
- </ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml
deleted file mode 100644
index be9776721..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml
+++ /dev/null
@@ -1,41 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Controls.DbTableView"
- 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"
- mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280">
- <Grid>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition Height="1*"/>
- </Grid.RowDefinitions>
-
- <Grid Background="#E9E9E9">
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10">
- <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Foreground="{Binding ElementName=txtSearch, Path=BorderBrush}" Kind="AccountSearch" />
- <TextBox x:Name="txtSearch" Text="{Binding Filter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" materialDesign:HintAssist.Hint="Search" Width="200" FontSize="14" />
- </StackPanel>
-
- <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" Margin="0 0 10 0">
- <Button Style="{StaticResource MaterialDesignFloatingActionDarkButton}" ToolTip="Remove" Command="{Binding DeleteCommand}" Width="40" Height="40">
- <materialDesign:PackIcon Width="20" Height="20" Kind="Delete" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionDarkButton}" ToolTip="Edit" Command="{Binding EditCommand}" Margin="10 0 0 0" Width="40" Height="40">
- <materialDesign:PackIcon Width="20" Height="20" Kind="Pencil" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionDarkButton}" ToolTip="Add" Command="{Binding AddCommand}" Margin="10 0 0 0" Width="40" Height="40">
- <materialDesign:PackIcon Width="20" Height="20" Kind="Plus" />
- </Button>
- </StackPanel>
- </Grid>
-
- <Grid Grid.Row="1">
- <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=MainContent}" Margin="0 60 0 0"></ContentControl>
- </Grid>
- </Grid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml.cs
deleted file mode 100644
index 19bee9e70..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/DbTableView.xaml.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-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.Markup;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace Tango.MachineStudio.UI.Controls
-{
- /// <summary>
- /// Interaction logic for DbTableView.xaml
- /// </summary>
- [ContentProperty(nameof(MainContent))]
- public partial class DbTableView : UserControl
- {
- public FrameworkElement MainContent
- {
- get { return (FrameworkElement)GetValue(MainContentProperty); }
- set { SetValue(MainContentProperty, value); }
- }
- public static readonly DependencyProperty MainContentProperty =
- DependencyProperty.Register("MainContent", typeof(FrameworkElement), typeof(DbTableView), new PropertyMetadata(null));
-
- public DbTableView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/TableGrid.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/TableGrid.cs
deleted file mode 100644
index 9b0d20362..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Controls/TableGrid.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace Tango.MachineStudio.UI.Controls
-{
- public class TableGrid : Grid
- {
- public TableGrid()
- {
- ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) });
- ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
- this.Loaded += TableGrid_Loaded;
- }
-
- private void TableGrid_Loaded(object sender, RoutedEventArgs e)
- {
- InvalidateGrid();
- }
-
- protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
- {
- base.OnVisualChildrenChanged(visualAdded, visualRemoved);
- }
-
- protected override Size ArrangeOverride(Size arrangeSize)
- {
- return base.ArrangeOverride(arrangeSize);
- }
-
- private void InvalidateGrid()
- {
- RowDefinitions.Clear();
- RowDefinitions.Add(new RowDefinition() { Height = new GridLength(50, GridUnitType.Pixel) });
-
- int currentRow = 0;
-
- for (int i = 0; i < Children.Count; i++)
- {
- SetRow(Children[i], currentRow);
-
- if (i % 2 != 0)
- {
- SetColumn(Children[i], 1);
- (Children[i] as FrameworkElement).Margin = new Thickness(20, 0, 0, 0);
- currentRow++;
- RowDefinitions.Add(new RowDefinition() { Height = new GridLength(50, GridUnitType.Pixel) });
- }
-
- (Children[i] as FrameworkElement).VerticalAlignment = VerticalAlignment.Bottom;
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Converters/UsersRolesToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Converters/UsersRolesToStringConverter.cs
deleted file mode 100644
index 734bc7135..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Converters/UsersRolesToStringConverter.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections;
-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.UI.ViewModels.DBViewModels;
-
-namespace Tango.MachineStudio.UI.Converters
-{
- public class UsersRolesToStringConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value == null) return "";
-
- if (value is IEnumerable<UsersRole>)
- {
- IEnumerable<UsersRole> userRoles = value as IEnumerable<UsersRole>;
- return String.Join(", ", userRoles.Where(x => !x.Deleted).Select(x => x.Role.Name));
- }
- else
- {
- IEnumerable<MultiComboVM<Role>> userRoles = value as IEnumerable<MultiComboVM<Role>>;
- return String.Join(", ", userRoles.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/Tango.MachineStudio.UI/CustomAttributes/DBViewAttribute.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/CustomAttributes/DBViewAttribute.cs
deleted file mode 100644
index 39f34c4e9..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/CustomAttributes/DBViewAttribute.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.MachineStudio.UI.CustomAttributes
-{
- public class DBViewAttribute : Attribute
- {
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/DialogsManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/DialogsManager.cs
deleted file mode 100644
index 4131f2a56..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/DialogsManager.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using Tango.DAL.Observables;
-using Tango.MachineStudio.UI.ViewModels.DBViewModels;
-using Tango.MachineStudio.UI.Views.DBViews;
-using Tango.MachineStudio.UI.Windows;
-
-namespace Tango.MachineStudio.UI.Managers
-{
- public static class DialogsManager
- {
- public static bool ShowDialog<T>(String title, object context) where T : FrameworkElement
- {
- DialogWindow dialog = new DialogWindow(Activator.CreateInstance<T>());
- dialog.DataContext = context;
- dialog.InnerTitle = title;
- dialog.Owner = Application.Current.MainWindow;
- return dialog.ShowDialog().Value;
- }
-
- public static bool ShowDialog<T>(DialogOpenMode mode, DbTableViewModel<T> context) where T : IObservableEntity
- {
- Type viewType = typeof(DialogsManager).Assembly.GetType(typeof(OrganizationView).Namespace + "." + typeof(T).Name + "View");
- DialogWindow dialog = new DialogWindow(Activator.CreateInstance(viewType) as FrameworkElement);
- dialog.InnerTitle = (mode == DialogOpenMode.Editing ? "Edit " : "Add New ") + typeof(T).Name;
- dialog.DataContext = context;
- dialog.Owner = Application.Current.MainWindow;
- MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible;
- bool result = dialog.ShowDialog().Value;
- MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden;
- return result;
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/RegisteredView.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/RegisteredView.cs
deleted file mode 100644
index de66500b9..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/RegisteredView.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using Tango.Core.Commands;
-
-namespace Tango.MachineStudio.UI.Managers
-{
- public class RegisteredView
- {
- public String Header { get; set; }
- public FrameworkElement View { get; set; }
- public RelayCommand AddCommand { get; set; }
-
- public RegisteredView(String header, FrameworkElement view, Action action)
- {
- Header = header;
- View = view;
-
- if (action != null)
- {
- AddCommand = new RelayCommand(action);
- }
- else
- {
- AddCommand = new RelayCommand(() =>
- {
- if (!ViewsManager.DisplayedViews.Contains(this))
- {
- ViewsManager.DisplayedViews.Add(this);
- }
- else
- {
- View.BringIntoView();
- View.Focus();
- }
- });
- }
- }
-
- public RegisteredView(String header, FrameworkElement view) : this(header, view, null)
- {
- Header = header;
- View = view;
- }
-
- public override string ToString()
- {
- return Header;
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/ViewsManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/ViewsManager.cs
deleted file mode 100644
index caa1cb320..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Managers/ViewsManager.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using Tango.Core.Commands;
-using Tango.MachineStudio.UI.CustomAttributes;
-using Tango.MachineStudio.UI.Views.DBViews;
-
-namespace Tango.MachineStudio.UI.Managers
-{
- public static class ViewsManager
- {
- public static ObservableCollection<RegisteredView> DisplayedViews { get; set; }
-
- public static ObservableCollection<RegisteredView> DbViews { get; set; }
-
- static ViewsManager()
- {
- DisplayedViews = new ObservableCollection<RegisteredView>();
- DbViews = new ObservableCollection<RegisteredView>();
-
- foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute)))
- {
- DbViews.Add(new RegisteredView(type.Name.Replace("View", ""), Activator.CreateInstance(type) as FrameworkElement));
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs
new file mode 100644
index 000000000..8e0fd2220
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.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 MaterialDesignThemes.Wpf;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.UI.Windows;
+
+namespace Tango.MachineStudio.UI.Notifications
+{
+ public class DefaultNotificationProvider : INotificationProvider
+ {
+ public bool ShowDialog<T>(PackIconKind icon, string title, object context) where T : FrameworkElement
+ {
+ return ShowDialog(icon, title, Activator.CreateInstance<T>(), context);
+ }
+
+ public bool ShowDialog(PackIconKind icon, string title, FrameworkElement content, object context)
+ {
+ DialogWindow dialog = new DialogWindow(content);
+ dialog.DataContext = context;
+ dialog.InnerTitle = title;
+ dialog.Owner = Application.Current.MainWindow;
+ MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible;
+ bool result = dialog.ShowDialog().Value;
+ MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden;
+ return result;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml
index f23776ec2..f23776ec2 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs
index c946d2b88..c946d2b88 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/DialogWindow.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 67e00db8d..6c008797f 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -41,10 +41,10 @@
<HintPath>..\..\packages\Dragablz.0.0.3.197\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
- <HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
+ <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
- <HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+ <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
<HintPath>..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
@@ -96,60 +96,16 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
- <Compile Include="Controls\DbTableView.xaml.cs">
- <DependentUpon>DbTableView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Controls\TableGrid.cs" />
- <Compile Include="Converters\UsersRolesToStringConverter.cs" />
- <Compile Include="CustomAttributes\DBViewAttribute.cs" />
- <Compile Include="ViewModels\DBViewModels\DbTableViewModel.cs" />
- <Compile Include="ViewModels\DBViewModels\DialogOpenMode.cs" />
- <Compile Include="ViewModels\DBViewModels\MultiComboVM.cs" />
- <Compile Include="ViewModels\DBViewModels\UsersViewVM.cs" />
- <Compile Include="ViewModels\EntityViewModel.cs" />
- <Compile Include="Managers\DialogsManager.cs" />
- <Compile Include="Managers\RegisteredView.cs" />
- <Compile Include="Managers\ViewsManager.cs" />
+ <Compile Include="Notifications\DefaultNotificationProvider.cs" />
<Compile Include="SupervisingController\IMainView.cs" />
- <Compile Include="ViewModels\DBViewModels\AddressesViewVM.cs" />
- <Compile Include="ViewModels\DBViewModels\MachinesViewVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModelLocator.cs" />
- <Compile Include="ViewModels\DBViewModels\OrganizationsViewVM.cs" />
- <Compile Include="Views\DBViews\AddressesView.xaml.cs">
- <DependentUpon>AddressesView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\AddressView.xaml.cs">
- <DependentUpon>AddressView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\MachinesView.xaml.cs">
- <DependentUpon>MachinesView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\MachineView.xaml.cs">
- <DependentUpon>MachineView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\OrganizationView.xaml.cs">
- <DependentUpon>OrganizationView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\UsersView.xaml.cs">
- <DependentUpon>UsersView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\DBViews\UserView.xaml.cs">
- <DependentUpon>UserView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\DBViews\OrganizationsView.xaml.cs">
- <DependentUpon>OrganizationsView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Windows\DialogWindow.xaml.cs">
+ <Compile Include="Notifications\DialogWindow.xaml.cs">
<DependentUpon>DialogWindow.xaml</DependentUpon>
</Compile>
- <Page Include="Controls\DbTableView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -169,43 +125,11 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
- <Page Include="Views\DBViews\AddressesView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Views\DBViews\AddressView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\DBViews\MachinesView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\DBViews\MachineView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\DBViews\OrganizationView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\DBViews\UsersView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\DBViews\UserView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="Views\MainView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\DBViews\OrganizationsView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Windows\DialogWindow.xaml">
+ <Page Include="Notifications\DialogWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -266,6 +190,14 @@
<Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project>
<Name>Tango.SharedUI</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.MachineStudio.DB\Tango.MachineStudio.DB.csproj">
+ <Project>{94f7acf8-55e1-4a02-b9bc-a818413fdbbf}</Project>
+ <Name>Tango.MachineStudio.DB</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tango.MachineStudio.Common\Tango.MachineStudio.Common.csproj">
+ <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project>
+ <Name>Tango.MachineStudio.Common</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\design.png" />
@@ -273,9 +205,7 @@
<ItemGroup>
<Resource Include="Images\machine-trans.png" />
</ItemGroup>
- <ItemGroup>
- <Folder Include="Dialogs\" />
- </ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>$(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk"</PostBuildEvent>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
index 2d3492ba0..1f08e31ca 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
@@ -3,9 +3,10 @@ using GalaSoft.MvvmLight.Ioc;
using Microsoft.Practices.ServiceLocation;
using System;
using Tango.Logging;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.UI.Notifications;
using Tango.MachineStudio.UI.SupervisingController;
using Tango.MachineStudio.UI.ViewModels;
-using Tango.MachineStudio.UI.ViewModels.DBViewModels;
using Tango.MachineStudio.UI.Views;
namespace Tango.MachineStudio.UI
@@ -34,11 +35,9 @@ namespace Tango.MachineStudio.UI
//// SimpleIoc.Default.Register<IDataService, DataService>();
////}
+ SimpleIoc.Default.Register<INotificationProvider>(() => new DefaultNotificationProvider());
+
SimpleIoc.Default.Register<MainViewVM>();
- SimpleIoc.Default.Register<MachinesViewVM>();
- SimpleIoc.Default.Register<OrganizationsViewVM>();
- SimpleIoc.Default.Register<AddressesViewVM>();
- SimpleIoc.Default.Register<UsersViewVM>();
//Register View (Supervising Controller Pattern).
if (!ViewModelBase.IsInDesignModeStatic)
@@ -55,37 +54,5 @@ namespace Tango.MachineStudio.UI
return ServiceLocator.Current.GetInstance<MainViewVM>();
}
}
-
- public MachinesViewVM MachinesViewVM
- {
- get
- {
- return ServiceLocator.Current.GetInstance<MachinesViewVM>();
- }
- }
-
- public OrganizationsViewVM OrganizationsViewVM
- {
- get
- {
- return ServiceLocator.Current.GetInstance<OrganizationsViewVM>();
- }
- }
-
- public AddressesViewVM AddressesViewVM
- {
- get
- {
- return ServiceLocator.Current.GetInstance<AddressesViewVM>();
- }
- }
-
- public UsersViewVM UsersViewVM
- {
- get
- {
- return ServiceLocator.Current.GetInstance<UsersViewVM>();
- }
- }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/AddressesViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/AddressesViewVM.cs
deleted file mode 100644
index 009de0139..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/AddressesViewVM.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.DAL.Observables;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public class AddressesViewVM : DbTableViewModel<Address>
- {
-
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DbTableViewModel.cs
deleted file mode 100644
index 2e3a6a6e1..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DbTableViewModel.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core.Commands;
-using Tango.DAL.Observables;
-using Tango.MachineStudio.UI.Managers;
-using Tango.SharedUI;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public abstract class DbTableViewModel<T> : ViewModel where T : IObservableEntity
- {
- private T _editEntity;
- /// <summary>
- /// Gets or sets the edit entity.
- /// </summary>
- public T EditEntity
- {
- get { return _editEntity; }
- set { _editEntity = value; RaisePropertyChangedAuto(); }
- }
-
- private DialogOpenMode _dialogOpenMode;
- /// <summary>
- /// Gets or sets the dialog open mode.
- /// </summary>
- public DialogOpenMode DialogOpenMode
- {
- get { return _dialogOpenMode; }
- set { _dialogOpenMode = value; RaisePropertyChangedAuto(); }
- }
-
- private bool _isDialogOpen;
- /// <summary>
- /// Gets or sets a value indicating whether this instance is dialog open.
- /// </summary>
- public bool IsDialogOpen
- {
- get { return _isDialogOpen; }
- set { _isDialogOpen = value; RaisePropertyChangedAuto(); }
- }
-
- private ObservablesEntitiesAdapter _adapter;
- /// <summary>
- /// Gets or sets the DB adapter.
- /// </summary>
- public ObservablesEntitiesAdapter Adapter
- {
- get { return _adapter; }
- set { _adapter = value; RaisePropertyChangedAuto(); }
- }
-
- private T _selectedEntity;
- /// <summary>
- /// Gets or sets the selected entity.
- /// </summary>
- public T SelectedEntity
- {
- get { return _selectedEntity; }
- set { _selectedEntity = value; RaisePropertyChangedAuto(); }
- }
-
- private String _filter;
- /// <summary>
- /// Gets or sets the search filter.
- /// </summary>
- public String Filter
- {
- get { return _filter; }
- set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(value); }
- }
-
- /// <summary>
- /// Gets or sets the dialog OK command.
- /// </summary>
- public RelayCommand DialogOKCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the dialog cancel command.
- /// </summary>
- public RelayCommand DialogCancelCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the add command.
- /// </summary>
- public RelayCommand AddCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the edit command.
- /// </summary>
- public RelayCommand EditCommand { get; set; }
-
- /// <summary>
- /// Gets or sets the delete command.
- /// </summary>
- public RelayCommand DeleteCommand { get; set; }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="DbTableViewModel"/> class.
- /// </summary>
- public DbTableViewModel() : base()
- {
- Adapter = App.DbAdapter;
-
- AddCommand = new RelayCommand(OnAdd);
- EditCommand = new RelayCommand(OnEdit);
- DeleteCommand = new RelayCommand(OnDelete);
- DialogOKCommand = new RelayCommand(() => OnDialogOKPressed(DialogOpenMode, EditEntity));
- DialogCancelCommand = new RelayCommand(() => OnDialogCancelPressed(DialogOpenMode, EditEntity));
-
- IsDialogOpen = false;
- }
-
- /// <summary>
- /// Called when delete command invoked.
- /// </summary>
- protected virtual void OnDelete()
- {
- SelectedEntity.Deleted = true;
- SelectedEntity.Save();
- }
-
- /// <summary>
- /// Called when edit command invoked.
- /// </summary>
- protected virtual void OnEdit()
- {
- DialogOpenMode = DialogOpenMode.Editing;
- EditEntity = GetEditableEntity(DialogOpenMode);
- DialogsManager.ShowDialog(DialogOpenMode, this);
- IsDialogOpen = true;
- }
-
- /// <summary>
- /// Called when add command invoked.
- /// </summary>
- protected virtual void OnAdd()
- {
- DialogOpenMode = DialogOpenMode.Adding;
- EditEntity = GetEditableEntity(DialogOpenMode);
- DialogsManager.ShowDialog(DialogOpenMode, this);
- IsDialogOpen = true;
- }
-
- /// <summary>
- /// Called when dialog closes with OK button.
- /// </summary>
- /// <param name="mode">The mode.</param>
- protected virtual void OnDialogOKPressed(DialogOpenMode mode, T entity)
- {
- if (mode == DialogOpenMode.Editing)
- {
- entity.ShallowCopyTo(SelectedEntity);
- entity = SelectedEntity;
- }
-
- OnBeforeEntitySave(mode, entity);
-
- entity.Save();
- IsDialogOpen = false;
- SelectedEntity = EditEntity;
- }
-
- /// <summary>
- /// Called when [before entity save].
- /// </summary>
- /// <param name="mode">The mode.</param>
- /// <param name="entity">The entity.</param>
- protected virtual void OnBeforeEntitySave(DialogOpenMode mode,T entity)
- {
-
- }
-
- /// <summary>
- /// Called when dialog closes with cancel button.
- /// </summary>
- /// <param name="mode">The mode.</param>
- protected virtual void OnDialogCancelPressed(DialogOpenMode mode, T entity)
- {
- IsDialogOpen = false;
- }
-
- /// <summary>
- /// Gets the editable entity.
- /// </summary>
- /// <param name="mode">The mode.</param>
- /// <returns></returns>
- private T GetEditableEntity(DialogOpenMode mode)
- {
- if (mode == DialogOpenMode.Adding)
- {
- var newEntity = Activator.CreateInstance<T>();
- InitializeEntity(newEntity);
- return newEntity;
- }
- else
- {
- return SelectedEntity.ShallowClone();
- }
- }
-
- protected virtual void OnFilterChanged(String filter)
- {
-
- }
-
- protected virtual void InitializeEntity(T entity)
- {
-
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DialogOpenMode.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DialogOpenMode.cs
deleted file mode 100644
index 9c6dbe807..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/DialogOpenMode.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public enum DialogOpenMode
- {
- Editing,
- Adding,
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MachinesViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MachinesViewVM.cs
deleted file mode 100644
index c008f1124..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MachinesViewVM.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core.Commands;
-using Tango.DAL.Observables;
-using Tango.SharedUI;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public class MachinesViewVM : DbTableViewModel<Machine>
- {
- protected override void InitializeEntity(Machine entity)
- {
- base.InitializeEntity(entity);
- entity.ProductionDate = DateTime.Now;
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MultiComboVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MultiComboVM.cs
deleted file mode 100644
index 280eab923..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/MultiComboVM.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.SharedUI;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public class MultiComboVM<T> : EntityViewModel<T>
- {
- private Action _onSelectionChanged;
-
- public event EventHandler SelectionChanged;
-
- public MultiComboVM(T entity) : base(entity)
- {
-
- }
-
- public MultiComboVM(T entity, Action onSelectionChanged) : this(entity)
- {
- _onSelectionChanged = onSelectionChanged;
- }
-
- private bool _isSelected;
-
- public bool IsSelected
- {
- get { return _isSelected; }
- set { _isSelected = value; RaisePropertyChangedAuto(); OnSelectionChanged(); }
- }
-
- protected virtual void OnSelectionChanged()
- {
- if (_onSelectionChanged != null)
- {
- _onSelectionChanged();
- }
-
- SelectionChanged?.Invoke(this, new EventArgs());
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/OrganizationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/OrganizationsViewVM.cs
deleted file mode 100644
index 6a2fd73df..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/OrganizationsViewVM.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.DAL.Observables;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public class OrganizationsViewVM : DbTableViewModel<Organization>
- {
- public OrganizationsViewVM() : base()
- {
-
- }
-
- protected override void OnFilterChanged(string filter)
- {
- Adapter.OrganizationsViewSource.Filter = (x) =>
- {
- var org = x as Organization;
- return org.Name.Contains(filter);
- };
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/UsersViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/UsersViewVM.cs
deleted file mode 100644
index 2bf34ce7a..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/DBViewModels/UsersViewVM.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.DAL.Observables;
-
-namespace Tango.MachineStudio.UI.ViewModels.DBViewModels
-{
- public class UsersViewVM : DbTableViewModel<User>
- {
- private ObservableCollection<MultiComboVM<Role>> _selectedRoles;
- public ObservableCollection<MultiComboVM<Role>> SelectedRoles
- {
- get { return _selectedRoles; }
- set { _selectedRoles = value; RaisePropertyChangedAuto(); }
- }
-
- public UsersViewVM() : base()
- {
- SelectedRoles = new ObservableCollection<MultiComboVM<Role>>();
- }
-
- protected override void OnEdit()
- {
- SelectedRoles = Adapter.Roles.Select(x => new MultiComboVM<Role>(x, () => RaisePropertyChanged(nameof(SelectedRoles)))).ToObservableCollection();
-
- foreach (var role in SelectedRoles)
- {
- if (SelectedEntity.UsersRoles.ToList().Exists(x => x.Role == role.Entity && !x.Deleted))
- {
- role.IsSelected = true;
- }
- }
-
- base.OnEdit();
- }
-
- protected override void OnAdd()
- {
- SelectedRoles = Adapter.Roles.Select(x => new MultiComboVM<Role>(x, () => RaisePropertyChanged(nameof(SelectedRoles)))).ToObservableCollection();
-
- base.OnAdd();
- }
-
- protected override void OnBeforeEntitySave(DialogOpenMode mode, User user)
- {
- base.OnBeforeEntitySave(mode, user);
-
- foreach (var role in SelectedRoles)
- {
- var userRole = user.UsersRoles.SingleOrDefault(x => x.Role == role.Entity);
-
- if (userRole != null)
- {
- userRole.Deleted = !role.IsSelected;
- }
- else
- {
- if (role.IsSelected)
- {
- user.UsersRoles.Add(new UsersRole()
- {
- Role = role.Entity,
- User = user,
- RoleGuid = role.Entity.Guid,
- UserGuid = user.Guid
- });
- }
- }
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/EntityViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/EntityViewModel.cs
deleted file mode 100644
index fff03a1db..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/EntityViewModel.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core.Commands;
-using Tango.SharedUI;
-
-namespace Tango.MachineStudio.UI.ViewModels
-{
- public class EntityViewModel<T> : ViewModel
- {
- private T _entity;
-
- public T Entity
- {
- get { return _entity; }
- set { _entity = value; RaisePropertyChanged(nameof(Entity)); }
- }
-
- public EntityViewModel() : base()
- {
-
- }
-
- public EntityViewModel(T entity) : this()
- {
- Entity = entity;
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml
deleted file mode 100644
index 8e1bde374..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.AddressView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views.DBViews"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
- <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="Address:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.AddressString,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Locality:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Locality,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Country:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Country,Mode=TwoWay}"></TextBox>
- <TextBlock Text="City:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.City,Mode=TwoWay}"></TextBox>
- <TextBlock Text="State:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.State,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Country Code:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.CountryCode,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Postal Code:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.PostalCode,Mode=TwoWay}"></TextBox>
- </controls:TableGrid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml.cs
deleted file mode 100644
index 9c82b9d82..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for AddressView.xaml
- /// </summary>
- public partial class AddressView : UserControl
- {
- public AddressView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml
deleted file mode 100644
index d8de4b15b..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml
+++ /dev/null
@@ -1,27 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.AddressesView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{Binding AddressesViewVM, Source={StaticResource Locator}}">
- <Grid>
- <controls:DbTableView>
- <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Addresses}" 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="Address" Binding="{Binding AddressString}"></DataGridTextColumn>
- <DataGridTextColumn Header="Locality" Binding="{Binding Locality}"></DataGridTextColumn>
- <DataGridTextColumn Header="Country" Binding="{Binding Country}"></DataGridTextColumn>
- <DataGridTextColumn Header="City" Binding="{Binding City}"></DataGridTextColumn>
- <DataGridTextColumn Header="State" Binding="{Binding State}"></DataGridTextColumn>
- <DataGridTextColumn Header="Country Code" Binding="{Binding CountryCode}"></DataGridTextColumn>
- <DataGridTextColumn Header="Postal Code" Binding="{Binding PostalCode}"></DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </controls:DbTableView>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml.cs
deleted file mode 100644
index 793b18c82..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/AddressesView.xaml.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-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.UI.CustomAttributes;
-using Tango.SharedUI.Controls;
-
-namespace Tango.MachineStudio.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for MachinesView.xaml
- /// </summary>
- [DBView]
- public partial class AddressesView : UserControl
- {
- public AddressesView() : base()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml
deleted file mode 100644
index 042676b3c..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml
+++ /dev/null
@@ -1,28 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.MachineView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views.DBViews"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
- <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="Serial Number:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.SerialNumber,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Organization:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Organizations}" SelectedItem="{Binding EditEntity.Organization,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>
- <TextBlock Text="Version:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.MachineVersions}" SelectedItem="{Binding EditEntity.MachineVersions,Mode=TwoWay}" DisplayMemberPath="Version"></ComboBox>
- </controls:TableGrid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml.cs
deleted file mode 100644
index 422268226..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachineView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for MachineView.xaml
- /// </summary>
- public partial class MachineView : UserControl
- {
- public MachineView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml
deleted file mode 100644
index 2c69d914f..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.MachinesView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{Binding MachinesViewVM, Source={StaticResource Locator}}">
- <Grid>
- <controls:DbTableView>
- <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Machines}" 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="Serial Number" Binding="{Binding SerialNumber}"></DataGridTextColumn>
- <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Version" Binding="{Binding MachineVersions.Version}"></DataGridTextColumn>
- <DataGridTextColumn Header="Organization" Binding="{Binding Organization.Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Configuration" Binding="{Binding MachinesConfigurations[0].Configuration.Name}"></DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </controls:DbTableView>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml.cs
deleted file mode 100644
index a6a6f2b47..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/MachinesView.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-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.UI.CustomAttributes;
-using Tango.MachineStudio.UI.Managers;
-using Tango.SharedUI.Controls;
-
-namespace Tango.MachineStudio.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for MachinesView.xaml
- /// </summary>
- [DBView]
- public partial class MachinesView : UserControl
- {
- public MachinesView() : base()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml
deleted file mode 100644
index 31be9356e..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml
+++ /dev/null
@@ -1,26 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.OrganizationView"
- 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:local="clr-namespace:Tango.MachineStudio.UI.Views.DBViews"
- xmlns:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
- <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="Name:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Address:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Addresses}" SelectedItem="{Binding EditEntity.Address}" DisplayMemberPath="AddressString"></ComboBox>
- <TextBlock Text="Contact:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Contacts}" SelectedItem="{Binding EditEntity.Contact}" DisplayMemberPath="FullName"></ComboBox>
- </controls:TableGrid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml.cs
deleted file mode 100644
index 8c17d51a7..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-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.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for OrganizationView.xaml
- /// </summary>
- public partial class OrganizationView : UserControl
- {
- public OrganizationView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml
deleted file mode 100644
index ef446f01c..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml
+++ /dev/null
@@ -1,26 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.OrganizationsView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:system="clr-namespace:System;assembly=mscorlib"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{Binding OrganizationsViewVM, Source={StaticResource Locator}}">
- <Grid>
- <controls:DbTableView>
- <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.OrganizationsViewSource}" 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="Name" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Address" Binding="{Binding Address.AddressString}"></DataGridTextColumn>
- <DataGridTextColumn Header="Contact" Binding="{Binding Contact.FullName}"></DataGridTextColumn>
- <DataGridTextColumn Header="Machines" Binding="{Binding Machines.Count}"></DataGridTextColumn>
- <DataGridTextColumn Header="Users" Binding="{Binding Users.Count}"></DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </controls:DbTableView>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml.cs
deleted file mode 100644
index 2e955de0c..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/OrganizationsView.xaml.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-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.UI.CustomAttributes;
-
-namespace Tango.MachineStudio.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for OrganizationsView.xaml
- /// </summary>
- [DBView]
- public partial class OrganizationsView : UserControl
- {
- public OrganizationsView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml
deleted file mode 100644
index 62802c5d9..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml
+++ /dev/null
@@ -1,43 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.UserView"
- 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:controls="clr-namespace:Tango.MachineStudio.UI.Controls"
- xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views.DBViews"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
-
- <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="Email:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Email,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Password:" FontWeight="Bold"></TextBlock>
- <TextBox Text="{Binding EditEntity.Password,Mode=TwoWay}"></TextBox>
- <TextBlock Text="Roles:" FontWeight="Bold"></TextBlock>
- <ComboBox x:Name="comboRoles" SelectionChanged="comboRoles_SelectionChanged" ItemsSource="{Binding SelectedRoles}" materialDesign:HintAssist.Hint="{Binding SelectedRoles,Converter={StaticResource UsersRolesToStringConverter},UpdateSourceTrigger=PropertyChanged}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <CheckBox IsChecked="{Binding IsSelected}" Width="20"/>
- <TextBlock Text="{Binding Entity.Name}" Width="100" />
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <TextBlock Text="Organization:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Organizations}" SelectedItem="{Binding EditEntity.Organization,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>
- <TextBlock Text="Address:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Addresses}" SelectedItem="{Binding EditEntity.Address}" DisplayMemberPath="AddressString"></ComboBox>
- <TextBlock Text="Contact:" FontWeight="Bold"></TextBlock>
- <ComboBox ItemsSource="{Binding Adapter.Contacts}" SelectedItem="{Binding EditEntity.Contact}" DisplayMemberPath="FullName"></ComboBox>
- </controls:TableGrid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml.cs
deleted file mode 100644
index 987c93b75..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UserView.xaml.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-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.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for UserView.xaml
- /// </summary>
- public partial class UserView : UserControl
- {
- public UserView()
- {
- InitializeComponent();
- }
-
- private void comboRoles_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- comboRoles.SelectedItem = null;
- comboRoles.Text = "Press to select";
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml
deleted file mode 100644
index 9225661a0..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml
+++ /dev/null
@@ -1,27 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.UI.Views.DBViews.UsersView"
- 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.UI.Controls"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views.DBViews"
- mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{Binding UsersViewVM, Source={StaticResource Locator}}">
-
- <Grid>
- <controls:DbTableView>
- <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.Users}" 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="Name" Binding="{Binding Contact.FullName}"></DataGridTextColumn>
- <DataGridTextColumn Header="Email" Binding="{Binding Email}"></DataGridTextColumn>
- <DataGridTextColumn Header="Password" Binding="{Binding Password}"></DataGridTextColumn>
- <DataGridTextColumn Header="Organization" Binding="{Binding Organization.Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Roles" Binding="{Binding UsersRoles,Converter={StaticResource UsersRolesToStringConverter}}"></DataGridTextColumn>
- <DataGridTextColumn Header="Address" Binding="{Binding Address.AddressString}"></DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </controls:DbTableView>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml.cs
deleted file mode 100644
index bc60c65cf..000000000
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/DBViews/UsersView.xaml.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-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.UI.CustomAttributes;
-
-namespace Tango.MachineStudio.UI.Views.DBViews
-{
- /// <summary>
- /// Interaction logic for UsersView.xaml
- /// </summary>
- [DBView]
- public partial class UsersView : UserControl
- {
- public UsersView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index fbe45d36d..f8424b26d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -7,7 +7,7 @@
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:managers="clr-namespace:Tango.MachineStudio.UI.Managers"
+ xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views;assembly=Tango.MachineStudio.DB"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1270" Background="White" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}">
@@ -59,23 +59,10 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <Grid>
- <Menu IsMainMenu="True">
- <MenuItem Header="DataBase" ItemsSource="{x:Static managers:ViewsManager.DbViews}" DisplayMemberPath="Header">
- <MenuItem.ItemContainerStyle>
- <Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
- <Setter Property="Command" Value="{Binding AddCommand}"></Setter>
- </Style>
- </MenuItem.ItemContainerStyle>
- </MenuItem>
- <MenuItem Header="Edit"></MenuItem>
- </Menu>
+ <Grid Grid.Row="1">
+ <db:MainDBView></db:MainDBView>
</Grid>
- <dockablz:Layout Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" FloatingItemsSource="{x:Static managers:ViewsManager.DisplayedViews}" FloatingItemDisplayMemberPath="View" FloatingItemHeaderMemberPath="Header">
-
- </dockablz:Layout>
-
<!--<dragablz:TabablzControl BorderThickness="0" FontSize="14" ItemContainerStyle="{DynamicResource TabItemStyle}">
<dragablz:TabablzControl.Resources>
<Style x:Key="TabItemStyle" TargetType="{x:Type dragablz:DragablzItem}" BasedOn="{StaticResource MaterialDesignDragableTabItemStyle}">
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config
index 05f5d8725..2da000205 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config
@@ -2,7 +2,7 @@
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net46" />
<package id="Dragablz" version="0.0.3.197" targetFramework="net46" />
- <package id="EntityFramework" version="6.2.0" targetFramework="net46" />
+ <package id="EntityFramework" version="6.0.0" targetFramework="net46" />
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" />