Procházet zdrojové kódy

Сделал отображение прав

Igor před 5 měsíci
rodič
revize
d724e9c62d

+ 2 - 2
src/SASDesktop/Navigation.cs

@@ -121,10 +121,10 @@ namespace SASDesktop
         
         public static void ToLicenseListExecuted()
         {
-            Popups.NotImplementedSorry();
+            GetMainFrame().Navigate(new Views.Managment.CitizenPassListOut());
         }
         
-        public static void ToTransportAssign()
+        public static void ToTransportAssignExecuted()
         {
             Popups.NotImplementedSorry();
         }

+ 23 - 0
src/SASDesktop/SASDesktop.csproj

@@ -196,6 +196,7 @@
     <Compile Include="ViewModels\Auth.cs" />
     <Compile Include="ViewModels\Drivers\Create.cs" />
     <Compile Include="ViewModels\Drivers\ListOutput.cs" />
+    <Compile Include="ViewModels\Managment\CitizenPassListOut.cs" />
     <Compile Include="ViewModels\Portal.cs" />
     <Compile Include="ViewModels\Transport\Create.cs" />
     <Compile Include="ViewModels\Transport\List.cs" />
@@ -208,6 +209,15 @@
     <Compile Include="Views\Drivers\DriverListOutput.xaml.cs">
       <DependentUpon>DriverListOutput.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Managment\CitizenPassListOut.xaml.cs">
+      <DependentUpon>CitizenPassListOut.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Managment\GivePassCitizen.xaml.cs">
+      <DependentUpon>GivePassCitizen.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Managment\WithDrowPassCitizen.xaml.cs">
+      <DependentUpon>WithDrowPassCitizen.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Portal.cs">
       <DependentUpon>Portal.xaml</DependentUpon>
     </Compile>
@@ -253,6 +263,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Managment\CitizenPassListOut.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Managment\GivePassCitizen.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Managment\WithDrowPassCitizen.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Portal.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -326,5 +348,6 @@
       <Name>VINlib</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 2 - 1
src/SASDesktop/ViewModels/Drivers/ListOutput.cs

@@ -1,4 +1,5 @@
-using Prism.Mvvm;
+using Prism.Commands;
+using Prism.Mvvm;
 using SASDesktop.Models;
 using System;
 using System.Collections.Generic;

+ 52 - 0
src/SASDesktop/ViewModels/Managment/CitizenPassListOut.cs

@@ -0,0 +1,52 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using SASDesktop.Models;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SASDesktop.ViewModels.Managment
+{
+    internal class CitizenPassListOut : BindableBase
+    {
+        public DelegateCommand AddCmd { get; set; }
+        public DelegateCommand EditCmd { get; set; }
+        public DelegateCommand DeleteCmd { get; set; }
+        public DelegateCommand BackCmd { get; set; }
+
+        public ObservableCollection<Models.License> lvOutPutPass { get; set; }
+
+
+        public CitizenPassListOut()
+        {
+            var db = new Models.SASEntities();
+            lvOutPutPass = new ObservableCollection<Models.License>(db.Licenses.ToList());
+            AddCmd = new DelegateCommand(AddCommand);    
+            EditCmd = new DelegateCommand(EditCommand);
+            DeleteCmd = new DelegateCommand(DeleteCommand);
+            BackCmd = new DelegateCommand(BackCommand);
+        }
+
+        public void AddCommand()
+        {
+            Popups.NotImplementedSorry();
+        }
+        public void EditCommand()
+        {
+            Popups.NotImplementedSorry();
+        }
+        public void DeleteCommand()
+        {
+            Popups.NotImplementedSorry();
+        }
+        public void BackCommand()
+        {
+            Navigation.GoBack();
+        }
+    }
+}

+ 83 - 0
src/SASDesktop/Views/Managment/CitizenPassListOut.xaml

@@ -0,0 +1,83 @@
+<Page x:Class="SASDesktop.Views.Managment.CitizenPassListOut"
+      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:SASDesktop.Views.Managment"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="CitizenPassListOut">
+    <ScrollViewer>
+        
+        <StackPanel
+        CanVerticallyScroll="True"
+        Style="{StaticResource FormContainer}">
+
+        <TextBlock HorizontalAlignment="Center"
+                   Style="{StaticResource H2}"
+                   Text="Список выданных прав"/>
+
+        <Grid>
+            <StackPanel>
+
+                <StackPanel Orientation="Horizontal">
+                    <Button Content="Добавить"
+                          Style="{StaticResource StandartButton}"
+                          Command="{Binding AddCmd}"/>
+                    <Button Content="Редактировать"
+                          Style="{StaticResource StandartButton}"
+                          Command="{Binding EditCmd}"/>
+                    <Button Content="Удалить"
+                          Style="{StaticResource StandartButton}"
+                          Command="{Binding DeleteCmd}"/>
+                    <Button Content="Назад"
+                          Style="{StaticResource StandartButton}"
+                          Command="{Binding BackCmd}"/>
+                </StackPanel>
+
+                <ListView ItemsSource="{Binding lvOutPutPass}" 
+                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                        Height="370">
+                    <ListView.ItemsPanel>
+                        <ItemsPanelTemplate>
+                            <WrapPanel Orientation="Horizontal"/>
+                        </ItemsPanelTemplate>
+                    </ListView.ItemsPanel>
+                    <ListView.ItemTemplate>
+                        <DataTemplate>
+                            <Grid>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="*"/>
+                                </Grid.ColumnDefinitions>
+                                    <StackPanel Width="200">
+                                        <StackPanel Orientation="Vertical">
+                                            <StackPanel Orientation="Horizontal">
+                                                <TextBlock Style="{StaticResource H5}" Text="Водитель:"/>
+                                                <TextBlock Margin="10 0 0 0" Style="{StaticResource H5}" Text="{Binding Path=Citizen1.GetHumanName}"/>
+                                            </StackPanel>
+                                            <StackPanel Orientation="Horizontal">
+                                                <TextBlock Style="{StaticResource H5}" Text="Серия и номер:"/>
+                                                <TextBlock Margin="5 0 0 0" Style="{StaticResource H5}" Text="{Binding Series}"/>
+                                                <TextBlock Margin="5 0 0 0" Style="{StaticResource H5}" Text="{Binding Number}"/>
+                                            </StackPanel>
+                                            <StackPanel Orientation="Horizontal">
+                                                <TextBlock Style="{StaticResource H5}" Text="Дата получения:"/>
+                                                <TextBlock Margin="10 0 0 0" Style="{StaticResource H5}" Text="{Binding DateStart, StringFormat=d}"/>
+                                            </StackPanel>
+                                            <StackPanel Orientation="Horizontal">
+                                                <TextBlock Style="{StaticResource H5}" Text="Дата окончания:"/>
+                                                <TextBlock Margin="10 0 0 0" Style="{StaticResource H5}" Text="{Binding DiateFinish, StringFormat=d}"/>
+                                            </StackPanel>
+                                        </StackPanel>
+                                    </StackPanel>
+                                </Grid>
+                        </DataTemplate>
+                    </ListView.ItemTemplate>
+                </ListView>
+            </StackPanel>
+        </Grid>
+        </StackPanel>
+    </ScrollViewer>
+</Page>

+ 29 - 0
src/SASDesktop/Views/Managment/CitizenPassListOut.xaml.cs

@@ -0,0 +1,29 @@
+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 SASDesktop.Views.Managment
+{
+    /// <summary>
+    /// Логика взаимодействия для CitizenPassListOut.xaml
+    /// </summary>
+    public partial class CitizenPassListOut : Page
+    {
+        public CitizenPassListOut()
+        {
+            InitializeComponent();
+            DataContext = new ViewModels.Managment.CitizenPassListOut();
+        }
+    }
+}

+ 14 - 0
src/SASDesktop/Views/Managment/GivePassCitizen.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="SASDesktop.Views.Managment.GivePassCitizen"
+      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:SASDesktop.Views.Managment"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="GivePassCitizen">
+
+    <Grid>
+        
+    </Grid>
+</Page>

+ 28 - 0
src/SASDesktop/Views/Managment/GivePassCitizen.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 SASDesktop.Views.Managment
+{
+    /// <summary>
+    /// Логика взаимодействия для GivePassCitizen.xaml
+    /// </summary>
+    public partial class GivePassCitizen : Page
+    {
+        public GivePassCitizen()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 14 - 0
src/SASDesktop/Views/Managment/WithDrowPassCitizen.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="SASDesktop.Views.Managment.WithDrowPassCitizen"
+      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:SASDesktop.Views.Managment"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="WithDrowPassCitizen">
+
+    <Grid>
+        
+    </Grid>
+</Page>

+ 28 - 0
src/SASDesktop/Views/Managment/WithDrowPassCitizen.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 SASDesktop.Views.Managment
+{
+    /// <summary>
+    /// Логика взаимодействия для WithDrowPassCitizen.xaml
+    /// </summary>
+    public partial class WithDrowPassCitizen : Page
+    {
+        public WithDrowPassCitizen()
+        {
+            InitializeComponent();
+        }
+    }
+}