gr672_pgv 4 gadi atpakaļ
vecāks
revīzija
273104e2b1

+ 22 - 1
ViolationNOT/AdminPage.xaml

@@ -9,6 +9,27 @@
       Title="НарушениямНет - Администратор">
 
     <Grid>
-        
+        <DataGrid x:Name="RequestList" Grid.Row="1" Margin="5" >
+            <DataGrid.Columns>
+                <DataGridTemplateColumn Header="Фото">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <Image Height="150" Width="150" Source="{Binding Photo}"></Image>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+                <DataGridTextColumn Binding="{Binding Address}" Header="Адресс"></DataGridTextColumn>
+                <DataGridTextColumn Binding="{Binding ViolationType.TypeName}" Header="Тип"></DataGridTextColumn>
+                <DataGridTextColumn Binding="{Binding Description}" Header="Описание"></DataGridTextColumn>
+                <DataGridTextColumn Binding="{Binding StrigFormatIsReviewed}" Header="Статус"></DataGridTextColumn>
+                <DataGridTemplateColumn>
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <Button x:Name="BtnShowViolation" Click="BtnShowViolation_Click">Просмотреть карточку</Button>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+            </DataGrid.Columns>
+        </DataGrid>
     </Grid>
 </Page>

+ 6 - 0
ViolationNOT/AdminPage.xaml.cs

@@ -23,6 +23,12 @@ namespace ViolationNOT
         public AdminPage()
         {
             InitializeComponent();
+            RequestList.SelectedItem = DB.db.Violation.ToList();
+        }
+
+        private void BtnShowViolation_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.Navigate(new ViolationPage());
         }
     }
 }

+ 1 - 1
ViolationNOT/UserPage.xaml

@@ -14,7 +14,7 @@
             <RowDefinition/>
         </Grid.RowDefinitions>
         <Button x:Name="BtnNewViolation" Click="BtnNewViolation_Click" Margin="5,0,500,0">Оформить новое нарушение</Button>
-        <DataGrid x:Name="RequestList" Grid.Row="1" Margin="5">
+        <DataGrid x:Name="RequestList" Grid.Row="1" Margin="5" >
             <DataGrid.Columns>
                 <DataGridTemplateColumn Header="Фото">
                     <DataGridTemplateColumn.CellTemplate>

+ 7 - 0
ViolationNOT/ViolationNOT.csproj

@@ -97,6 +97,9 @@
     <Compile Include="Violation.cs">
       <DependentUpon>ModelViolation.tt</DependentUpon>
     </Compile>
+    <Compile Include="ViolationPage.xaml.cs">
+      <DependentUpon>ViolationPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="ViolationPartial.cs" />
     <Compile Include="ViolationType.cs">
       <DependentUpon>ModelViolation.tt</DependentUpon>
@@ -133,6 +136,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="ViolationPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ModelViolation.Context.cs">

+ 48 - 0
ViolationNOT/ViolationPage.xaml

@@ -0,0 +1,48 @@
+<Page x:Class="ViolationNOT.ViolationPage"
+      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:ViolationNOT"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Карточка заявления">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition Height="50"/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="1">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+            <TextBlock Margin="5">Адресс</TextBlock>
+            <TextBox Grid.Row="1" Text="{Binding Address}" Height="Auto" Margin="5" TextWrapping="Wrap"></TextBox>
+            <TextBlock Grid.Row="2" Margin="5">Описание</TextBlock>
+            <TextBox Grid.Row="3" Text="{Binding Description}" Height="Auto" Margin="5"></TextBox>
+        </Grid>
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+            <TextBlock Text="Тип нарушения"></TextBlock>
+            <StackPanel Grid.Row="1">
+                <TextBox Name="TxtCaType" Height="30" Margin="5" ></TextBox>
+                <TextBox x:Name="TxtCarNumber" Margin="5"></TextBox>
+            </StackPanel>
+            <Image Grid.Row="3" Name="Photo" Margin="5"></Image>
+        </Grid>
+        <Button x:Name="Yes" Grid.Row="1" Margin="5">Одобрить</Button>
+        <Button x:Name="No" Grid.Row="1" Margin="5">Отклонить</Button>
+    </Grid>
+</Page>

+ 28 - 0
ViolationNOT/ViolationPage.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 ViolationNOT
+{
+    /// <summary>
+    /// Interaction logic for ViolationPage.xaml
+    /// </summary>
+    public partial class ViolationPage : Page
+    {
+        public ViolationPage()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 36 - 2
ViolationNOT/obj/Debug/AdminPage.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\AdminPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9F105F0B71E8E770A9A71DDDE87ADBE89B2439C9C1B95530D273AC5E88D93CDC"
+#pragma checksum "..\..\AdminPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "34B154E3E1B4BFF7D7091F7104602212B143CD4AE94561B5EFB647294E64DF5D"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -38,7 +38,15 @@ namespace ViolationNOT {
     /// <summary>
     /// AdminPage
     /// </summary>
-    public partial class AdminPage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
+    public partial class AdminPage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector {
+        
+        
+        #line 12 "..\..\AdminPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.DataGrid RequestList;
+        
+        #line default
+        #line hidden
         
         private bool _contentLoaded;
         
@@ -68,8 +76,34 @@ namespace ViolationNOT {
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
         void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.RequestList = ((System.Windows.Controls.DataGrid)(target));
+            return;
+            }
             this._contentLoaded = true;
         }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 2:
+            
+            #line 28 "..\..\AdminPage.xaml"
+            ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnShowViolation_Click);
+            
+            #line default
+            #line hidden
+            break;
+            }
+        }
     }
 }
 

+ 1 - 1
ViolationNOT/obj/Debug/UserPage.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\UserPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A45486A0636802DD7501D351DF242EF875AE2BB2415E1C9ACBCECBA37231B6C8"
+#pragma checksum "..\..\UserPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0549A7BBDF3DB537B6F16C5A460A1A4DF8C042301C496574A1C1CA4B42BBE84"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.

+ 3 - 3
ViolationNOT/obj/Debug/ViolationNOT_MarkupCompile.i.cache

@@ -10,11 +10,11 @@ none
 false
 DEBUG;TRACE
 C:\Users\gr672_pgv\source\repos\ViolationNOT\ViolationNOT\App.xaml
-6-307844502
+7-1968427451
 2-795375389
-23466568214
+24728715835
 181538935744
-AdminPage.xaml;AuthPage.xaml;MainWindow.xaml;NewViolationPage.xaml;RegistrationPage.xaml;UserPage.xaml;
+AdminPage.xaml;AuthPage.xaml;MainWindow.xaml;NewViolationPage.xaml;RegistrationPage.xaml;UserPage.xaml;ViolationPage.xaml;
 
 True
 

+ 1 - 1
ViolationNOT/obj/Debug/ViolationNOT_MarkupCompile.i.lref

@@ -1,4 +1,4 @@
 
 
-FC:\Users\gr672_pgv\source\repos\ViolationNOT\ViolationNOT\NewViolationPage.xaml;;
+FC:\Users\gr672_pgv\source\repos\ViolationNOT\ViolationNOT\ViolationPage.xaml;;
 

+ 102 - 0
ViolationNOT/obj/Debug/ViolationPage.g.i.cs

@@ -0,0 +1,102 @@
+// Updated by XamlIntelliSenseFileGenerator 3/31/2021 12:29:59 PM
+#pragma checksum "..\..\ViolationPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B2C5F7EEDA6A6A4F16A1E93BB2B8CB6055C6543173540F08E80E0667BC72D981"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+using ViolationNOT;
+
+
+namespace ViolationNOT
+{
+
+
+    /// <summary>
+    /// ViolationPage
+    /// </summary>
+    public partial class ViolationPage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector
+    {
+
+#line default
+#line hidden
+
+        private bool _contentLoaded;
+
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent()
+        {
+            if (_contentLoaded)
+            {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/ViolationNOT;component/violationpage.xaml", System.UriKind.Relative);
+
+#line 1 "..\..\ViolationPage.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+
+#line default
+#line hidden
+        }
+
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
+        {
+            switch (connectionId)
+            {
+                case 1:
+                    this.BtnAddViolation = ((System.Windows.Controls.Button)(target));
+
+#line 28 "..\..\ViolationPage.xaml"
+                    this.BtnAddViolation.Click += new System.Windows.RoutedEventHandler(this.BtnAddViolation_Click);
+
+#line default
+#line hidden
+                    return;
+            }
+            this._contentLoaded = true;
+        }
+
+        internal System.Windows.Controls.TextBox TxtCaType;
+        internal System.Windows.Controls.TextBox TxtCarNumber;
+        internal System.Windows.Controls.Image Photo;
+        internal System.Windows.Controls.Button Yes;
+        internal System.Windows.Controls.Button No;
+    }
+}
+