aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml
blob: d5a5d41d7596bcc1406b9a54f84ec78255cb1ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight
<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: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"
             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" />
        <providers:PlacesProvider x:Key="PlacesProvider" />
    </UserControl.Resources>

    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="400"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>

            <Border Background="{StaticResource TransparentBackgroundBrush420}" BorderBrush="{StaticResource GrayBrush}" 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="{StaticResource TransparentBackgroundBrush420}" Height="300">
                            <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>

                        <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="{StaticResource TransparentBackgroundBrush420}" Height="250">
                            <local:ContactView DataContext="{Binding ManagedOrganization.Contact}" />
                        </Border>

                        <Button  Margin="0 40 0 0" MinWidth="160" Height="50" Command="{Binding SaveOrganizationCommand}" Background="Gray" BorderBrush="Gray">
                            <StackPanel Orientation="Horizontal">
                                <materialDesign:PackIcon Kind="ContentSave" Width="20" Height="20" />
                                <TextBlock Margin="5 0 0 0" FontSize="16">SAVE</TextBlock>
                            </StackPanel>
                        </Button>

                    </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="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" 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="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" 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="{StaticResource borderBrush}" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" 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>