diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-07 16:28:54 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-07 16:28:54 +0200 |
| commit | e317a7943e47c34e731729eacc46f8ce48905927 (patch) | |
| tree | 03eed8c169f33bced31e63d97aa0ec2848b2c145 /Software | |
| parent | c435be14ccb975b5666da84a7324ec55c3575842 (diff) | |
| download | Tango-e317a7943e47c34e731729eacc46f8ce48905927.tar.gz Tango-e317a7943e47c34e731729eacc46f8ce48905927.zip | |
Working on Users & Roles Module.
Diffstat (limited to 'Software')
51 files changed, 1349 insertions, 19 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex aeccb05c6..cd8aeb6d6 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex bab4ce367..0ef97d776 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Graphics/organization.png b/Software/Graphics/organization.png Binary files differnew file mode 100644 index 000000000..9f7ee9851 --- /dev/null +++ b/Software/Graphics/organization.png diff --git a/Software/Graphics/users-and-roles.jpg b/Software/Graphics/users-and-roles.jpg Binary files differnew file mode 100644 index 000000000..2304e25b6 --- /dev/null +++ b/Software/Graphics/users-and-roles.jpg diff --git a/Software/Graphics/users.png b/Software/Graphics/users.png Binary files differnew file mode 100644 index 000000000..805700c66 --- /dev/null +++ b/Software/Graphics/users.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ColorLabModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ColorLabModule.cs index 41cd13cc4..3e63051ee 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ColorLabModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ColorLabModule.cs @@ -50,7 +50,7 @@ namespace Tango.MachineStudio.ColorLab { get { - return Permissions.RunDeveloperModule; + return Permissions.RunColorLabModule; } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/organization.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/organization.png Binary files differnew file mode 100644 index 000000000..9f7ee9851 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/organization.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users-and-roles.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users-and-roles.jpg Binary files differnew file mode 100644 index 000000000..2304e25b6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users-and-roles.jpg diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users.png Binary files differnew file mode 100644 index 000000000..805700c66 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Images/users.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationManager.cs new file mode 100644 index 000000000..b335f2d69 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationManager.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Logging; +using Tango.MachineStudio.Common.Navigation; +using Tango.MachineStudio.UsersAndRoles.Views; + +namespace Tango.MachineStudio.UsersAndRoles.Navigation +{ + public class UsersAndRolesNavigationManager + { + private LogManager LogManager = LogManager.Default; + + public void NavigateTo(UsersAndRolesNavigationView view) + { + LogManager.Log(String.Format("Navigating to view {0}...", view.ToString())); + MainView.Instance.TransitionControl.AutoNavigate(view.ToString()); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationView.cs new file mode 100644 index 000000000..1e266926e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Navigation/UsersAndRolesNavigationView.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.UsersAndRoles.Navigation +{ + public enum UsersAndRolesNavigationView + { + OrganizationSelectionView, + OrganizationManagementView, + UserManagementView, + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..aeb6b6c4d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Machine Studio Users & Roles Module")] + +[assembly: ComVisible(false)] + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.Designer.cs new file mode 100644 index 000000000..5148a36ea --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.UsersAndRoles.Properties { + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.MachineStudio.UsersAndRoles.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.Designer.cs new file mode 100644 index 000000000..77bb41a9c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.UsersAndRoles.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.settings b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj new file mode 100644 index 000000000..cfba775b8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj @@ -0,0 +1,198 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{88028F14-0028-4DED-B119-19B8EE23CF32}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.MachineStudio.UsersAndRoles</RootNamespace> + <AssemblyName>Tango.MachineStudio.UsersAndRoles</AssemblyName> + <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\Build\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <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.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath> + </Reference> + <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignColors, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="Navigation\UsersAndRolesNavigationManager.cs" /> + <Compile Include="Navigation\UsersAndRolesNavigationView.cs" /> + <Compile Include="UsersAndRolesModule.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="Views\AddressView.xaml.cs"> + <DependentUpon>AddressView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ContactView.xaml.cs"> + <DependentUpon>ContactView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\OrganizationManagementView.xaml.cs"> + <DependentUpon>OrganizationManagementView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\OrganizationSelectionView.xaml.cs"> + <DependentUpon>OrganizationSelectionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\UserManagementView.xaml.cs"> + <DependentUpon>UserManagementView.xaml</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\SideChains\Tango.AutoComplete\Tango.AutoComplete.csproj"> + <Project>{bb2abb74-ba58-4812-83aa-ec8171f42df4}</Project> + <Name>Tango.AutoComplete</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</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> + <Page Include="Views\AddressView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\ContactView.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\OrganizationManagementView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\OrganizationSelectionView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\UserManagementView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\organization.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\users-and-roles.jpg" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\users.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/UsersAndRolesModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/UsersAndRolesModule.cs new file mode 100644 index 000000000..c0d1326cf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/UsersAndRolesModule.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.UsersAndRoles.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.UsersAndRoles +{ + public class UsersAndRolesModule : StudioModuleBase + { + public override string Name + { + get + { + return "Users & Roles"; + } + } + + public override string Description + { + get + { + return "Manage organizations users and their roles."; + } + } + + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/users-and-roles.jpg"); + } + } + + public override FrameworkElement MainView + { + get + { + return new MainView(); + } + } + + public override Permissions Permission + { + get + { + return Permissions.RunUsersAndRolesModule; + } + } + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModelLocator.cs new file mode 100644 index 000000000..588d2db09 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModelLocator.cs @@ -0,0 +1,36 @@ +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Ioc; +using Microsoft.Practices.ServiceLocation; +using Tango.MachineStudio.UsersAndRoles.Navigation; +using Tango.MachineStudio.UsersAndRoles.ViewModels; + +namespace Tango.MachineStudio.UsersAndRoles +{ + /// <summary> + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// </summary> + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); + + SimpleIoc.Default.Register<MainViewVM>(); + + SimpleIoc.Default.Unregister<UsersAndRolesNavigationManager>(); + SimpleIoc.Default.Register<UsersAndRolesNavigationManager>(() => new UsersAndRolesNavigationManager()); + } + + public static MainViewVM MainViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MainViewVM>(); + } + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..9c10dc126 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.UsersAndRoles.Navigation; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UsersAndRoles.ViewModels +{ + public class MainViewVM : ViewModel + { + private ObservablesContext _organizationsContext; + private ObservablesContext _manageContext; + private ObservablesContext _userContext; + private UsersAndRolesNavigationManager _navigation; + private INotificationProvider _notification; + + private ObservableCollection<Organization> _organizations; + public ObservableCollection<Organization> Organizations + { + get { return _organizations; } + set { _organizations = value; RaisePropertyChangedAuto(); } + } + + private Organization _selectedOrganization; + public Organization SelectedOrganization + { + get { return _selectedOrganization; } + set { _selectedOrganization = value; RaisePropertyChangedAuto(); } + } + + private Organization _managedOrganization; + public Organization ManagedOrganization + { + get { return _managedOrganization; } + set { _managedOrganization = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<Role> _roles; + public ObservableCollection<Role> Roles + { + get { return _roles; } + set { _roles = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<Permission> _permissions; + public ObservableCollection<Permission> Permissions + { + get { return _permissions; } + set { _permissions = value; RaisePropertyChangedAuto(); } + } + + private User _selectedUser; + public User SelectedUser + { + get { return _selectedUser; } + set { _selectedUser = value; RaisePropertyChangedAuto(); } + } + + private User _managedUser; + public User ManagedUser + { + get { return _managedUser; } + set { _managedUser = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand ManageOrganizationCommand { get; set; } + + public RelayCommand BackToOrganizationsCommand { get; set; } + + public RelayCommand ManageUserCommand { get; set; } + + public MainViewVM(UsersAndRolesNavigationManager navigation, INotificationProvider notification) + { + _navigation = navigation; + _notification = notification; + + LoadOrganizations(); + + ManageOrganizationCommand = new RelayCommand(ManageOrganization, () => SelectedOrganization != null); + BackToOrganizationsCommand = new RelayCommand(BackToOrganizations); + ManageUserCommand = new RelayCommand(ManageUser, () => SelectedUser != null); + } + + private void ManageUser() + { + using (_notification.PushTaskItem("Loading user details...")) + { + Task.Factory.StartNew(() => + { + _userContext = ObservablesContext.CreateDefault(); + ManagedUser = _manageContext.Users.SingleOrDefault(x => x.Guid == SelectedUser.Guid); + + InvokeUI(() => _navigation.NavigateTo(UsersAndRolesNavigationView.UserManagementView)); + }); + } + } + + private void BackToOrganizations() + { + _navigation.NavigateTo(UsersAndRolesNavigationView.OrganizationSelectionView); + } + + private void ManageOrganization() + { + using (_notification.PushTaskItem("Loading organization...")) + { + Task.Factory.StartNew(() => + { + _manageContext = ObservablesContext.CreateDefault(); + ManagedOrganization = _manageContext.Organizations.SingleOrDefault(x => x.Guid == SelectedOrganization.Guid); + + InvokeUI(() => _navigation.NavigateTo(UsersAndRolesNavigationView.OrganizationManagementView)); + }); + } + } + + private void LoadOrganizations() + { + _organizationsContext = ObservablesContext.CreateDefault(); + _organizationsContext.Configuration.LazyLoadingEnabled = false; + + _organizationsContext.Users.ToList(); + _organizationsContext.Contacts.ToList(); + _organizationsContext.Addresses.ToList(); + _organizationsContext.Machines.ToList(); + + Organizations = _organizationsContext.Organizations.ToObservableCollection(); + } + + protected override void RaisePropertyChangedAuto([CallerMemberName] string caller = null) + { + base.RaisePropertyChangedAuto(caller); + InvalidateRelayCommands(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml new file mode 100644 index 000000000..41f7871e2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml @@ -0,0 +1,33 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.AddressView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=entities:Address, IsDesignTimeCreatable=False}"> + <Grid> + <controls:TableGrid> + <TextBlock Text="COUNTRY"></TextBlock> + <autoComplete:AutoCompleteTextBox SelectedItem="{Binding Country}" /> + <TextBlock Text="COUNTRY CODE"></TextBlock> + <TextBox IsReadOnly="True" Text="{Binding CountryCode}"></TextBox> + <TextBlock Text="STATE"></TextBlock> + <TextBox Text="{Binding State}"></TextBox> + <TextBlock Text="CITY"></TextBlock> + <autoComplete:AutoCompleteTextBox SelectedItem="{Binding City}" /> + <TextBlock Text="POSTAL CODE"></TextBlock> + <mahApps:NumericUpDown Maximum="99999999999" FlowDirection="RightToLeft" Minimum="0" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" HideUpDownButtons="True" Value="{Binding PostalCode}"></mahApps:NumericUpDown> + <TextBlock Text="LOCALITY"></TextBlock> + <autoComplete:AutoCompleteTextBox SelectedItem="{Binding Locality}" /> + <TextBlock Text="ADDRESS"></TextBlock> + <TextBox Text="{Binding AddressString}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml.cs new file mode 100644 index 000000000..e5d644626 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for AddressView.xaml + /// </summary> + public partial class AddressView : UserControl + { + public AddressView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.xaml new file mode 100644 index 000000000..dfff19f12 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.ContactView" + 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:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=entities:Contact, IsDesignTimeCreatable=False}"> + <Grid> + <controls:TableGrid> + <TextBlock>FIRST NAME</TextBlock> + <TextBox Text="{Binding FirstName}"></TextBox> + <TextBlock>LAST NAME</TextBlock> + <TextBox Text="{Binding FirstName}"></TextBox> + <TextBlock>EMAIL</TextBlock> + <TextBox Text="{Binding Email}"></TextBox> + <TextBlock>PHONE NUMBER</TextBlock> + <TextBox Text="{Binding PhoneNumber}"></TextBox> + <TextBlock>FAX</TextBlock> + <TextBox Text="{Binding Fax}"></TextBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.xaml.cs new file mode 100644 index 000000000..fad93d63d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/ContactView.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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for ContactView.xaml + /// </summary> + public partial class ContactView : UserControl + { + public ContactView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml new file mode 100644 index 000000000..90166f445 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml @@ -0,0 +1,28 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.MainView" + 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.UsersAndRoles" + xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid> + <controls:MultiTransitionControl x:Name="TransitionControl" TransitionType="Slide"> + <controls:MultiTransitionControl.Controls> + <ContentControl Tag="OrganizationSelectionView"> + <local:OrganizationSelectionView/> + </ContentControl> + <ContentControl Tag="OrganizationManagementView"> + <local:OrganizationManagementView/> + </ContentControl> + <ContentControl Tag="UserManagementView"> + <local:UserManagementView/> + </ContentControl> + </controls:MultiTransitionControl.Controls> + </controls:MultiTransitionControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml.cs new file mode 100644 index 000000000..9fe030a3a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/MainView.xaml.cs @@ -0,0 +1,31 @@ +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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class MainView : UserControl + { + public static MainView Instance { get; set; } + + public MainView() + { + InitializeComponent(); + Instance = this; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml new file mode 100644 index 000000000..b91a22750 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml @@ -0,0 +1,135 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.OrganizationManagementView" + 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.UsersAndRoles" + xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="Transparent"> + + <UserControl.Resources> + <converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" /> + </UserControl.Resources> + + <Grid> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="400"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <Border Background="#A6FFFFFF" BorderBrush="Gray" BorderThickness="0 0 1 0"> + <Grid Margin="10 20 10 10"> + <StackPanel HorizontalAlignment="Center"> + + <StackPanel Orientation="Horizontal" Margin="-30 0 0 30"> + <Image Source="../Images/organization.png" Width="58" /> + <TextBlock Margin="10 0 0 0" FontSize="40" VerticalAlignment="Center" Text="{Binding ManagedOrganization.Name}"></TextBlock> + </StackPanel> + + <TextBlock FontSize="14" FontWeight="SemiBold">ADDRESS</TextBlock> + + <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="#A9FFFFFF"> + <local:AddressView DataContext="{Binding ManagedOrganization.Address}" /> + </Border> + + <TextBlock FontSize="14" FontWeight="SemiBold" Margin="0 40 0 0">CONTACT</TextBlock> + + <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="#A9FFFFFF"> + <local:ContactView DataContext="{Binding ManagedOrganization.Contact}" /> + </Border> + </StackPanel> + </Grid> + </Border> + + <Grid Grid.Column="1"> + <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="30" FontStyle="Italic" Margin="150 40"> + <Run Text="{Binding ManagedOrganization.Name}"></Run> <Run Text="Users"></Run> + </TextBlock> + <DockPanel Margin="100" MaxWidth="1200"> + <Grid DockPanel.Dock="Top"> + <StackPanel> + <Image Source="../Images/users.png" Width="300" Height="250" /> + <Button Margin="0 -210 0 0" MinWidth="160" Height="50" Command="{Binding BackToOrganizationsCommand}" HorizontalAlignment="Left"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="KeyboardBackspace" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">BACK</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + <Grid DockPanel.Dock="Bottom"> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveUserCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> + </StackPanel> + </Button> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddUserCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">NEW USER</TextBlock> + </StackPanel> + </Button> + </StackPanel> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Margin="50 0 0 0" MinWidth="200" Height="60" Command="{Binding ManageUserCommand}"> + <StackPanel Orientation="Horizontal"> + <TextBlock FontSize="18" VerticalAlignment="Center">MANAGE</TextBlock> + <materialDesign:PackIcon Margin="5 0 0 0" Kind="ChevronRight" Width="30" Height="30" /> + </StackPanel> + </Button> + </StackPanel> + </Grid> + <Grid> + <DataGrid Margin="0 0 0 10" ItemsSource="{Binding ManagedOrganization.Users}" SelectedItem="{Binding SelectedUser}" d:DataContext="{d:DesignInstance Type=entities:User, IsDesignTimeCreatable=False}" BorderBrush="Silver" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTextColumn Header="LAST UPDATED" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="1*" /> + <DataGridTextColumn Header="NAME" Binding="{Binding Contact.FullName}" Width="1*" /> + <DataGridTextColumn Header="LOGIN EMAIL" Binding="{Binding Email}" Width="1*" /> + <DataGridTextColumn Header="CONTACT EMAIL" Binding="{Binding Contact.Email}" Width="1*" /> + <DataGridTextColumn Header="ADDRESS" Binding="{Binding Address.AddressString}" Width="1*" /> + <DataGridTemplateColumn Header="ROLES" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Roles[0].Name}" TextTrimming="CharacterEllipsis"> + <TextBlock.ToolTip> + <ItemsControl ItemsSource="{Binding Roles}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal" Margin="2"> + <materialDesign:PackIcon Kind="AccountKey" Width="16" Height="16" /> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </TextBlock.ToolTip> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml.cs new file mode 100644 index 000000000..76b256d62 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for OrganizationManagementView.xaml + /// </summary> + public partial class OrganizationManagementView : UserControl + { + public OrganizationManagementView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml new file mode 100644 index 000000000..16dd36360 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml @@ -0,0 +1,69 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.OrganizationSelectionView" + 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.UsersAndRoles.Views" + xmlns:global="clr-namespace:Tango.MachineStudio.UsersAndRoles" + xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="Transparent"> + + <UserControl.Resources> + <converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" /> + </UserControl.Resources> + + <Grid> + <DockPanel Margin="100" MaxWidth="1200"> + <Grid DockPanel.Dock="Top"> + <Image Source="../Images/organization.png" Width="300" /> + </Grid> + <Grid DockPanel.Dock="Bottom"> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveOrganizationCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> + </StackPanel> + </Button> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddOrganizationCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">NEW ORGANIZATION</TextBlock> + </StackPanel> + </Button> + </StackPanel> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Margin="50 0 0 0" MinWidth="200" Height="60" Command="{Binding ManageOrganizationCommand}"> + <StackPanel Orientation="Horizontal"> + <TextBlock FontSize="18" VerticalAlignment="Center">MANAGE</TextBlock> + <materialDesign:PackIcon Margin="5 0 0 0" Kind="ChevronRight" Width="30" Height="30" /> + </StackPanel> + </Button> + </StackPanel> + </Grid> + <Grid> + <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Organizations}" SelectedItem="{Binding SelectedOrganization}"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="1*" /> + <DataGridTextColumn Header="LAST UPDATED" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="1*" /> + <DataGridTextColumn Header="CONTACT" Binding="{Binding Contact.FullName}" Width="1*" /> + <DataGridTextColumn Header="ADDRESS" Binding="{Binding Address.AddressString}" Width="1*" /> + <DataGridTextColumn Header="MACHINES" Binding="{Binding Machines.Count}" Width="1*" /> + <DataGridTextColumn Header="USERS" Binding="{Binding Users.Count}" Width="1*" /> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml.cs new file mode 100644 index 000000000..16c8b2b24 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for OrganizationSelectionView.xaml + /// </summary> + public partial class OrganizationSelectionView : UserControl + { + public OrganizationSelectionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml new file mode 100644 index 000000000..0a3fec2ff --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml @@ -0,0 +1,20 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.UserManagementView" + 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.UsersAndRoles" + xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="Transparent"> + <Grid> + <TextBlock Text="{Binding ManagedUser.Contact.FullName}"></TextBlock> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml.cs new file mode 100644 index 000000000..88319cbb3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.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.UsersAndRoles.Views +{ + /// <summary> + /// Interaction logic for UserManagementView.xaml + /// </summary> + public partial class UserManagementView : UserControl + { + public UserManagementView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config new file mode 100644 index 000000000..cf0df03c8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/packages.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> + <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> + <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> + <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> + <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> +</packages>
\ No newline at end of file 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 52bd44239..78978bda3 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 @@ -371,6 +371,10 @@ <Project>{5d39c1e1-3ecd-4634-bd1b-2bcf71c54a15}</Project> <Name>Tango.MachineStudio.Technician</Name> </ProjectReference> + <ProjectReference Include="..\Modules\Tango.MachineStudio.UsersAndRoles\Tango.MachineStudio.UsersAndRoles.csproj"> + <Project>{88028f14-0028-4ded-b119-19b8ee23cf32}</Project> + <Name>Tango.MachineStudio.UsersAndRoles</Name> + </ProjectReference> <ProjectReference Include="..\Tango.MachineStudio.Common\Tango.MachineStudio.Common.csproj"> <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project> <Name>Tango.MachineStudio.Common</Name> 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 a4256436c..8e6fa36f5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -48,16 +48,19 @@ <StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image> <StackPanel Margin="0 5 0 0"> - <TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName}"></TextBlock> + <TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName}"></TextBlock> <TextBlock FontSize="12" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" Margin="10 5 0 0" VerticalAlignment="Center"> <Run Text="{Binding AuthenticationProvider.CurrentUser.Organization.Name}"></Run> , - <Run Text="{Binding AuthenticationProvider.CurrentUser.Roles[0]}"> + <Run Text="{Binding AuthenticationProvider.CurrentUser.Roles[0].Name}"> <Run.ToolTip> <ItemsControl ItemsSource="{Binding AuthenticationProvider.CurrentUser.Roles}"> <ItemsControl.ItemTemplate> <DataTemplate> - <TextBlock Text="{Binding Name}"></TextBlock> + <StackPanel Orientation="Horizontal" Margin="2"> + <materialDesign:PackIcon Kind="AccountKey" Width="16" Height="16" /> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs index 8ab24b308..8ab24b308 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Cat.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs index 3f95ed149..3f95ed149 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Cat.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Cat.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Configuration.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs index 963ed638d..963ed638d 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Configuration.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Configuration.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs index 0a97a3f9a..0a97a3f9a 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Job.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs index e5854a406..e5854a406 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Job.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Machine.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs index e00715795..e00715795 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Machine.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Machine.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs index aeec23b33..aeec23b33 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineVersion.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/ProcessParametersTable.cs index 0bb75120e..0bb75120e 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/ProcessParametersTable.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Segment.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs index 6f37f4788..6f37f4788 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/User.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/User.cs index 52b3970dc..62614743c 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/User.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/User.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -24,20 +25,21 @@ namespace Tango.BL.Entities /// <summary> /// Gets the aggregated user roles as enumerations. /// </summary> - public List<Roles> Roles + [NotMapped] + public List<Role> Roles { - get { return UsersRoles.Select(x => (Roles)x.Role.Code).ToList(); } + get { return UsersRoles.Select(x => x.Role).ToList(); } } /// <summary> /// Gets the aggregated user permissions as enumerations. /// </summary> - public List<Permissions> Permissions + [NotMapped] + public List<Permission> Permissions { - get { - return UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).Select(x => (Permissions)x.Permission.Code).ToList(); + return UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).Select(x => x.Permission).ToList(); } } } diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs index a8a4aa2c0..ee77c6f0f 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs @@ -63,5 +63,17 @@ namespace Tango.BL.Enumerations [Description("Allows loading the stubs module in machine studio")] RunStubsModule = 8, + /// <summary> + /// (Allows loading the ColorLab module in Machine Studio) + /// </summary> + [Description("Allows loading the ColorLab module in Machine Studio")] + RunColorLabModule = 9, + + /// <summary> + /// (Allows loading the Users & Roles module in machine studio) + /// </summary> + [Description("Allows loading the Users & Roles module in machine studio")] + RunUsersAndRolesModule = 10, + } } diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/Roles.cs b/Software/Visual_Studio/Tango.BL/Enumerations/Roles.cs index c99739f12..f86a73cfb 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/Roles.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/Roles.cs @@ -51,5 +51,17 @@ namespace Tango.BL.Enumerations [Description("Twine Software Developer")] SoftwareDeveloper = 6, + /// <summary> + /// (Manage organizations users and roles) + /// </summary> + [Description("Manage organizations users and roles")] + UsersAndRolesManager = 7, + + /// <summary> + /// (Color adjustment & calibration algorithms developer ) + /// </summary> + [Description("Color adjustment & calibration algorithms developer ")] + ColorScientist = 8, + } } diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 79667148b..6096d698f 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -181,16 +181,16 @@ <Compile Include="ObservablesContextExtension.cs" /> <Compile Include="ObservablesEntitiesAdapter.cs" /> <Compile Include="ObservablesEntitiesAdapterExtension.cs" /> - <Compile Include="ObservablesExtensions\BrushStop.cs" /> - <Compile Include="ObservablesExtensions\Cat.cs" /> - <Compile Include="ObservablesExtensions\Configuration.cs" /> - <Compile Include="ObservablesExtensions\HardwareVersion.cs" /> - <Compile Include="ObservablesExtensions\Job.cs" /> - <Compile Include="ObservablesExtensions\Machine.cs" /> - <Compile Include="ObservablesExtensions\MachineVersion.cs" /> - <Compile Include="ObservablesExtensions\ProcessParametersTable.cs" /> - <Compile Include="ObservablesExtensions\Segment.cs" /> - <Compile Include="ObservablesExtensions\User.cs" /> + <Compile Include="EntitiesExtensions\BrushStop.cs" /> + <Compile Include="EntitiesExtensions\Cat.cs" /> + <Compile Include="EntitiesExtensions\Configuration.cs" /> + <Compile Include="EntitiesExtensions\HardwareVersion.cs" /> + <Compile Include="EntitiesExtensions\Job.cs" /> + <Compile Include="EntitiesExtensions\Machine.cs" /> + <Compile Include="EntitiesExtensions\MachineVersion.cs" /> + <Compile Include="EntitiesExtensions\ProcessParametersTable.cs" /> + <Compile Include="EntitiesExtensions\Segment.cs" /> + <Compile Include="EntitiesExtensions\User.cs" /> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs new file mode 100644 index 000000000..356320a0c --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs @@ -0,0 +1,58 @@ +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.SharedUI.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/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 856056cdc..6743a90e5 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -86,6 +86,7 @@ <Compile Include="Controls\ScriptEditorControl.xaml.cs"> <DependentUpon>ScriptEditorControl.xaml</DependentUpon> </Compile> + <Compile Include="Controls\TableGrid.cs" /> <Compile Include="Controls\TransitionTypeEnum.cs" /> <Compile Include="Controls\View.cs" /> <Compile Include="Converters\BooleanInverseConverter.cs" /> diff --git a/Software/Visual_Studio/4.sln b/Software/Visual_Studio/Tango.sln index 8973f3988..654857e10 100644 --- a/Software/Visual_Studio/4.sln +++ b/Software/Visual_Studio/Tango.sln @@ -155,6 +155,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.BrushPicker", "Tango. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.ColorLab", "MachineStudio\Modules\Tango.MachineStudio.ColorLab\Tango.MachineStudio.ColorLab.csproj", "{4D183ACA-552B-4135-AE81-7C5A8E5FC3B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.UsersAndRoles", "MachineStudio\Modules\Tango.MachineStudio.UsersAndRoles\Tango.MachineStudio.UsersAndRoles.csproj", "{88028F14-0028-4DED-B119-19B8EE23CF32}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2040,6 +2042,36 @@ Global {4D183ACA-552B-4135-AE81-7C5A8E5FC3B1}.Release|x64.Build.0 = Release|Any CPU {4D183ACA-552B-4135-AE81-7C5A8E5FC3B1}.Release|x86.ActiveCfg = Release|Any CPU {4D183ACA-552B-4135-AE81-7C5A8E5FC3B1}.Release|x86.Build.0 = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|ARM.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|ARM.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|ARM64.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|x64.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|x64.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|x86.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Debug|x86.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|Any CPU.Build.0 = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|ARM.ActiveCfg = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|ARM.Build.0 = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|ARM64.ActiveCfg = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|ARM64.Build.0 = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x64.ActiveCfg = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x64.Build.0 = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x86.ActiveCfg = Release|Any CPU + {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2086,6 +2118,7 @@ Global {793FBFC1-549E-458B-A52F-784BD4F28586} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} {BDBBE284-F564-4F51-AF41-3DF0434CEC62} = {34839F9A-61D3-4ED3-B3F7-7DA3424CB0B6} {4D183ACA-552B-4135-AE81-7C5A8E5FC3B1} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} + {88028F14-0028-4DED-B119-19B8EE23CF32} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} |
