diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-12 17:03:38 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-12 17:03:38 +0200 |
| commit | e75cf513acb73558e948d6012b45f221c718dcf7 (patch) | |
| tree | 386d3cd79048edbfb91860b6a063fba3c660fec5 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views | |
| parent | c923d6611ffa64605879779c490a979e03daa189 (diff) | |
| download | Tango-e75cf513acb73558e948d6012b45f221c718dcf7.tar.gz Tango-e75cf513acb73558e948d6012b45f221c718dcf7.zip | |
Added cascade delete for Machine -> Jobs.
Added addresses auto complete to users & roles.
Maybe Users & Roles module is complete..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views')
7 files changed, 100 insertions, 12 deletions
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 index 41f7871e2..937cf14dd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/AddressView.xaml @@ -15,17 +15,17 @@ <Grid> <controls:TableGrid> <TextBlock Text="COUNTRY"></TextBlock> - <autoComplete:AutoCompleteTextBox SelectedItem="{Binding Country}" /> + <TextBox Text="{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}" /> + <TextBox Text="{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> + <TextBox Text="{Binding PostalCode}"></TextBox> <TextBlock Text="LOCALITY"></TextBlock> - <autoComplete:AutoCompleteTextBox SelectedItem="{Binding Locality}" /> + <TextBox Text="{Binding Locality}" /> <TextBlock Text="ADDRESS"></TextBlock> <TextBox Text="{Binding AddressString}"></TextBox> </controls:TableGrid> 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 index 7769f65ed..64b05769a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml @@ -9,6 +9,7 @@ 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:providers="clr-namespace:Tango.MachineStudio.UsersAndRoles.Providers" 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" @@ -17,6 +18,7 @@ <UserControl.Resources> <converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" /> + <providers:PlacesProvider x:Key="PlacesProvider" /> </UserControl.Resources> <Grid> @@ -38,7 +40,13 @@ <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" Height="300"> - <local:AddressView DataContext="{Binding ManagedOrganization.Address}" /> + <DockPanel> + <DockPanel DockPanel.Dock="Top"> + <materialDesign:PackIcon Kind="Magnify" DockPanel.Dock="Left" Width="24" Height="24" /> + <autoComplete:AutoCompleteTextBox x:Name="address_auto" Margin="5 0 0 0" Delay="500" DisplayMember="DisplayName" SelectedItem="{Binding SelectedOrganizationPlace,Mode=OneWayToSource}" Provider="{StaticResource PlacesProvider}" materialDesign:HintAssist.Hint="Find address" /> + </DockPanel> + <local:AddressView DataContext="{Binding ManagedOrganization.Address}" /> + </DockPanel> </Border> <TextBlock FontSize="14" FontWeight="SemiBold" Margin="0 40 0 0">CONTACT</TextBlock> 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 index 76b256d62..e2c44a584 100644 --- 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 @@ -12,17 +12,23 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using static Tango.SharedUI.Controls.MultiTransitionControl; namespace Tango.MachineStudio.UsersAndRoles.Views { /// <summary> /// Interaction logic for OrganizationManagementView.xaml /// </summary> - public partial class OrganizationManagementView : UserControl + public partial class OrganizationManagementView : UserControl , ITransitionView { public OrganizationManagementView() { InitializeComponent(); } + + public void OnTransitionCompleted() + { + address_auto.Text = ""; + } } } 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 index b92682b84..ccb38b198 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml @@ -5,6 +5,7 @@ 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:providers="clr-namespace:Tango.MachineStudio.UsersAndRoles.Providers" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" @@ -16,6 +17,10 @@ mc:Ignorable="d" d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <UserControl.Resources> + <providers:PlacesProvider x:Key="PlacesProvider" /> + </UserControl.Resources> + <Grid> <Grid> <Grid.ColumnDefinitions> @@ -39,19 +44,31 @@ <TextBlock Text="{Binding ManagedUser.Contact.FullName,FallbackValue='Roy Ben Shabat'}" VerticalAlignment="Center" FontSize="25" Margin="10 0 0 0"></TextBlock> </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 20 0 0" HorizontalAlignment="Center"> + <StackPanel Orientation="Horizontal" Margin="0 20 0 0" HorizontalAlignment="Right"> <StackPanel> - <TextBlock FontSize="16" FontWeight="SemiBold">ADDRESS</TextBlock> - <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="5" Height="300" Background="#8EFFFFFF"> - <local:AddressView FontSize="10" DataContext="{Binding ManagedUser.Address}" /> + <TextBlock FontSize="16" FontWeight="SemiBold">LOGIN</TextBlock> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="150" Background="#8EFFFFFF"> + <local:UserView FontSize="10" DataContext="{Binding ManagedUser}" /> </Border> </StackPanel> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="16" FontWeight="SemiBold">CONTACT</TextBlock> - <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="5" Height="300" Background="#8EFFFFFF"> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="250" Background="#8EFFFFFF"> <local:ContactView FontSize="10" DataContext="{Binding ManagedUser.Contact}" /> </Border> </StackPanel> + <StackPanel Margin="10 0 0 0"> + <TextBlock FontSize="16" FontWeight="SemiBold">ADDRESS</TextBlock> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="300" Background="#8EFFFFFF"> + <DockPanel> + <DockPanel DockPanel.Dock="Top"> + <materialDesign:PackIcon Kind="Magnify" DockPanel.Dock="Left" Width="24" Height="24" /> + <autoComplete:AutoCompleteTextBox x:Name="address_auto" Margin="5 0 0 0" Delay="500" DisplayMember="DisplayName" SelectedItem="{Binding SelectedUserPlace,Mode=OneWayToSource}" Provider="{StaticResource PlacesProvider}" materialDesign:HintAssist.Hint="Find address" /> + </DockPanel> + <local:AddressView FontSize="10" DataContext="{Binding ManagedUser.Address}" /> + </DockPanel> + </Border> + </StackPanel> </StackPanel> </StackPanel> </Grid> 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 index b26f0ea03..f2ff25637 100644 --- 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 @@ -15,13 +15,14 @@ using System.Windows.Shapes; using Tango.BL.Entities; using Tango.DragAndDrop; using Tango.MachineStudio.UsersAndRoles.ViewModels; +using static Tango.SharedUI.Controls.MultiTransitionControl; namespace Tango.MachineStudio.UsersAndRoles.Views { /// <summary> /// Interaction logic for UserManagementView.xaml /// </summary> - public partial class UserManagementView : UserControl + public partial class UserManagementView : UserControl, ITransitionView { private MainViewVM _vm; @@ -47,5 +48,10 @@ namespace Tango.MachineStudio.UsersAndRoles.Views _vm.OnDropRole(e.Draggable.DataContext as Role); } } + + public void OnTransitionCompleted() + { + address_auto.Text = ""; + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.xaml new file mode 100644 index 000000000..6c7596015 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:pass="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=entities:User, IsDesignTimeCreatable=False}"> + + + + <Grid> + <controls:TableGrid> + <TextBlock Text="EMAIL"></TextBlock> + <TextBox Text="{Binding Email}"></TextBox> + <TextBlock Text="PASSWORD"></TextBlock> + <PasswordBox MaxLength="30" pass:PasswordHelper.Attach="True" pass:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.xaml.cs new file mode 100644 index 000000000..b617bdbc4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserView.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 UserView.xaml + /// </summary> + public partial class UserView : UserControl + { + public UserView() + { + InitializeComponent(); + } + } +} |
