Артем Гавриленко 3 years ago
parent
commit
ca41b69baf

+ 1 - 1
Kusach/App.config

@@ -7,4 +7,4 @@
   <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
   </startup>
-<connectionStrings><add name="gr692_gavEntities" connectionString="metadata=res://*/EDM.csdl|res://*/EDM.ssdl|res://*/EDM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(localdb)\MSSQLLocalDB;initial catalog=gr692_gav;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>
+<connectionStrings><add name="EDMEntities" connectionString="metadata=res://*/EDM.csdl|res://*/EDM.ssdl|res://*/EDM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(localdb)\MSSQLLocalDB;initial catalog=gr692_gav;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>

+ 3 - 3
Kusach/Dispatcher.cs

@@ -23,9 +23,9 @@ namespace Kusach
         public int IdDispatcher { get; set; }
         public string Login { get; set; }
         public string Password { get; set; }
-        public string FName { get; set; }
-        public string LName { get; set; }
-        public string MName { get; set; }
+        public string Surname { get; set; }
+        public string Name { get; set; }
+        public string Patronymic { get; set; }
         public System.DateTime Birthday { get; set; }
         public string PhoneNumber { get; set; }
     

+ 3 - 3
Kusach/EDM.Context.cs

@@ -13,10 +13,10 @@ namespace Kusach
     using System.Data.Entity;
     using System.Data.Entity.Infrastructure;
     
-    public partial class gr692_gavEntities : DbContext
+    public partial class EDMEntities : DbContext
     {
-        public gr692_gavEntities()
-            : base("name=gr692_gavEntities")
+        public EDMEntities()
+            : base("name=EDMEntities")
         {
         }
     

+ 11 - 11
Kusach/EDM.edmx

@@ -12,9 +12,9 @@
           <Property Name="IdDispatcher" Type="int" Nullable="false" />
           <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="FName" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="LName" Type="nvarchar" MaxLength="50" Nullable="false" />
-          <Property Name="MName" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Surname" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Patronymic" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Birthday" Type="date" Nullable="false" />
           <Property Name="PhoneNumber" Type="nvarchar" MaxLength="10" Nullable="false" />
         </EntityType>
@@ -220,9 +220,9 @@
           <Property Name="IdDispatcher" Type="Int32" Nullable="false" />
           <Property Name="Login" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
-          <Property Name="FName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
-          <Property Name="LName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
-          <Property Name="MName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Surname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Patronymic" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="Birthday" Type="DateTime" Nullable="false" Precision="0" />
           <Property Name="PhoneNumber" Type="String" MaxLength="10" FixedLength="false" Unicode="true" Nullable="false" />
           <NavigationProperty Name="RouteList" Relationship="Self.FK__RouteList__IdRou__6383C8BA" FromRole="Dispatcher" ToRole="RouteList" />
@@ -391,7 +391,7 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <EntityContainer Name="gr692_gavEntities" annotation:LazyLoadingEnabled="true">
+        <EntityContainer Name="EDMEntities" annotation:LazyLoadingEnabled="true">
           <EntitySet Name="Dispatcher" EntityType="Self.Dispatcher" />
           <EntitySet Name="Drivers" EntityType="Self.Drivers" />
           <EntitySet Name="DriversList" EntityType="Self.DriversList" />
@@ -435,16 +435,16 @@
     <!-- C-S mapping content -->
     <edmx:Mappings>
       <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
-        <EntityContainerMapping StorageEntityContainer="Хранилище gr692_gavModelContainer" CdmEntityContainer="gr692_gavEntities">
+        <EntityContainerMapping StorageEntityContainer="Хранилище gr692_gavModelContainer" CdmEntityContainer="EDMEntities">
           <EntitySetMapping Name="Dispatcher">
             <EntityTypeMapping TypeName="gr692_gavModel.Dispatcher">
               <MappingFragment StoreEntitySet="Dispatcher">
                 <ScalarProperty Name="IdDispatcher" ColumnName="IdDispatcher" />
                 <ScalarProperty Name="Login" ColumnName="Login" />
                 <ScalarProperty Name="Password" ColumnName="Password" />
-                <ScalarProperty Name="FName" ColumnName="FName" />
-                <ScalarProperty Name="LName" ColumnName="LName" />
-                <ScalarProperty Name="MName" ColumnName="MName" />
+                <ScalarProperty Name="Surname" ColumnName="Surname" />
+                <ScalarProperty Name="Name" ColumnName="Name" />
+                <ScalarProperty Name="Patronymic" ColumnName="Patronymic" />
                 <ScalarProperty Name="Birthday" ColumnName="Birthday" />
                 <ScalarProperty Name="PhoneNumber" ColumnName="PhoneNumber" />
               </MappingFragment>

+ 11 - 12
Kusach/EDM.edmx.diagram

@@ -4,21 +4,20 @@
   <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
-      <Diagram DiagramId="38901bcb7be948d8a17031ad142ca7d0" Name="Diagram1" ZoomLevel="72">
-        <EntityTypeShape EntityType="gr692_gavModel.Dispatcher" Width="1.5" PointX="3.75" PointY="6" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.Drivers" Width="1.5" PointX="6.625" PointY="3.375" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.DriversList" Width="1.5" PointX="3.75" PointY="3.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.Points" Width="1.5" PointX="7" PointY="0.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.PointsList" Width="1.5" PointX="4.125" PointY="0.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.RouteList" Width="1.5" PointX="0.875" PointY="6" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.Routes" Width="1.5" PointX="0.875" PointY="1" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.sysdiagrams" Width="1.5" PointX="10.25" PointY="1" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_gavModel.Transport" Width="1.5" PointX="6.625" PointY="6.375" IsExpanded="true" />
+      <Diagram DiagramId="b8240537cd7c460697af7edf661a78ae" Name="Diagram1">
+        <EntityTypeShape EntityType="gr692_gavModel.Dispatcher" Width="1.5" PointX="0.75" PointY="13.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.Drivers" Width="1.5" PointX="0.75" PointY="6.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.DriversList" Width="1.5" PointX="3" PointY="3.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.Points" Width="1.5" PointX="0.75" PointY="1" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.PointsList" Width="1.5" PointX="3" PointY="0.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.RouteList" Width="1.5" PointX="3" PointY="6.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.Routes" Width="1.5" PointX="0.75" PointY="3.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.sysdiagrams" Width="1.5" PointX="5.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr692_gavModel.Transport" Width="1.5" PointX="1.5" PointY="10" IsExpanded="true" />
         <AssociationConnector Association="gr692_gavModel.FK__RouteList__IdRou__6383C8BA" ManuallyRouted="false" />
         <AssociationConnector Association="gr692_gavModel.FK__DriversLi__IdDri__0C85DE4D" ManuallyRouted="false" />
         <AssociationConnector Association="gr692_gavModel.FK_Drivers_Transport" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_gavModel.FK__DriversLi__IdRou__68487DD7" ManuallyRouted="false" >
-        </AssociationConnector>
+        <AssociationConnector Association="gr692_gavModel.FK__DriversLi__IdRou__68487DD7" ManuallyRouted="false" />
         <AssociationConnector Association="gr692_gavModel.FK__PointsLis__IdPoi__6477ECF3" ManuallyRouted="false" />
         <AssociationConnector Association="gr692_gavModel.FK__PointsLis__IdRou__66603565" ManuallyRouted="false" />
         <AssociationConnector Association="gr692_gavModel.FK__RouteList__IdRou__628FA481" ManuallyRouted="false" />

+ 32 - 40
Kusach/Kusach.csproj

@@ -73,22 +73,6 @@
     <Compile Include="AddPointWindow.xaml.cs">
       <DependentUpon>AddPointWindow.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Windows\AddRouteWindow.xaml.cs">
-      <DependentUpon>AddRouteWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="AddTransportWindow.xaml.cs">
-      <DependentUpon>AddTransportWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="AddUserWindow.xaml.cs">
-      <DependentUpon>AddUserWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="cnt.cs" />
-    <Compile Include="DataWindow.xaml.cs">
-      <DependentUpon>DataWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="DeleteUserWindow.xaml.cs">
-      <DependentUpon>DeleteUserWindow.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Dispatcher.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
@@ -113,25 +97,12 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>EDM.edmx</DependentUpon>
     </Compile>
-    <Compile Include="Encrypt.cs" />
-    <Compile Include="LogWindow.xaml.cs">
-      <DependentUpon>LogWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Pages\RoutesListPage.xaml.cs">
-      <DependentUpon>RoutesListPage.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Points.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
     <Compile Include="PointsList.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
-    <Compile Include="RegWindow.xaml.cs">
-      <DependentUpon>RegWindow.xaml</DependentUpon>
-    </Compile>
     <Compile Include="RouteList.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
@@ -141,18 +112,44 @@
     <Compile Include="sysdiagrams.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
+    <Compile Include="Transport.cs">
+      <DependentUpon>EDM.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Windows\AddRouteWindow.xaml.cs">
+      <DependentUpon>AddRouteWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AddTransportWindow.xaml.cs">
+      <DependentUpon>AddTransportWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AddUserWindow.xaml.cs">
+      <DependentUpon>AddUserWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="cnt.cs" />
+    <Compile Include="DataWindow.xaml.cs">
+      <DependentUpon>DataWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="DeleteUserWindow.xaml.cs">
+      <DependentUpon>DeleteUserWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Encrypt.cs" />
+    <Compile Include="LogWindow.xaml.cs">
+      <DependentUpon>LogWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Pages\RoutesListPage.xaml.cs">
+      <DependentUpon>RoutesListPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="RegWindow.xaml.cs">
+      <DependentUpon>RegWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="TestPGPage.xaml.cs">
       <DependentUpon>TestPGPage.xaml</DependentUpon>
     </Compile>
     <Compile Include="TestRouteEditWindow.xaml.cs">
       <DependentUpon>TestRouteEditWindow.xaml</DependentUpon>
     </Compile>
-    <Compile Include="TestWindow.xaml.cs">
-      <DependentUpon>TestWindow.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Transport.cs">
-      <DependentUpon>EDM.tt</DependentUpon>
-    </Compile>
     <Page Include="AddDriverWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -209,10 +206,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="TestWindow.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">
@@ -251,7 +244,6 @@
   <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
   </ItemGroup>
-  <ItemGroup />
   <ItemGroup>
     <Content Include="EDM.Context.tt">
       <Generator>TextTemplatingFileGenerator</Generator>

+ 2 - 2
Kusach/LogWindow.xaml.cs

@@ -25,8 +25,8 @@ namespace Kusach
                     MessageBox.Show("Поля не могут быть пустыми.");
                 else if (cnt.db.Dispatcher.Select(item => item.Login + item.Password).Contains(logbox.Text + Encrypt.GetHash(passbox.Password)))
                 {
-                    DataWindow dw = new DataWindow();
-                    dw.Show();
+                    MainWindow mw = new MainWindow();
+                    mw.Show();
                     this.Close();
                 }
                 else

+ 2 - 2
Kusach/RegWindow.xaml.cs

@@ -38,8 +38,8 @@ namespace Kusach
                     cnt.db.Dispatcher.Add(newUser);
                     cnt.db.SaveChanges();
                     MessageBox.Show("Вы успешно зарегистрировались");
-                    DataWindow dw = new DataWindow();
-                    dw.Show();
+                    MainWindow mw = new MainWindow();
+                    mw.Show();
                     this.Close();
                 }
             }

+ 160 - 39
Kusach/TestRouteEditWindow.xaml

@@ -7,51 +7,172 @@
         mc:Ignorable="d"
         Title="TestRouteEditWindow" Height="450" Width="800">
     <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="65*"/>
+            <RowDefinition Height="354*"/>
+        </Grid.RowDefinitions>
         <Button
-            Content="Button" 
+            Content="Назад" 
             HorizontalAlignment="Left" 
-            Margin="10,10,0,0" 
             VerticalAlignment="Top" 
-            Width="91" 
-            Height="50" Click="Button_Click"/>
+            Margin="10,10,0,0" 
+            Width="90" 
+            Height="50" 
+            Click="Button_Click"/>
         <TextBox
             Name="RouteNameBox"
-            Height="50"
-            Margin="129,10,548,359"
+            Margin="105,10,10,5"
             Text="Маршрут: #0"
-            />
-
-        <DataGrid 
-            Name="PointsListDataGrid" 
-            AutoGenerateColumns="False" 
-            Height="344" 
-            VerticalAlignment="Top" 
+            FontSize="16"/>
+        <StackPanel
+            Visibility="Hidden"
+            VerticalAlignment="Center"
             HorizontalAlignment="Center" 
-            Width="772" Margin="10,65,10,0">
-            <DataGrid.ItemContainerStyle>
-                <Style TargetType="DataGridRow">
-                    <EventSetter 
-                        Event="MouseDoubleClick" 
-                        Handler="DataGridRow_MouseDoubleClick"/>
-                </Style>
-            </DataGrid.ItemContainerStyle>
-            <DataGrid.Columns>
-                <DataGridTextColumn 
-                    Binding="{Binding Points.IdPoint}" 
-                    Header="IdPoint"  
-                    Width="100" 
-                    IsReadOnly="True"/>
-                <DataGridTextColumn 
-                    Binding="{Binding Points.Name}" 
-                    Header="Name" 
-                    Width="100" 
-                    IsReadOnly="True"/>
-                <DataGridTextColumn 
-                    Binding="{Binding Points.location}" 
-                    Header="location" 
-                    Width="100"
-                    IsReadOnly="True"/>
-            </DataGrid.Columns>
-        </DataGrid>
+            Margin="254,16,238,9" 
+            Width="300" 
+            Height="40">
+            <Button
+            Content="Удалить точку"/>
+            <Button
+            Content="Добавить точку"/>
+        </StackPanel>
+
+        <Grid 
+            Grid.Row="1"
+            Margin="10,0,10,0">
+            <TabControl>
+                <TabItem 
+                Height="30" 
+                Width="120">
+                    <TabItem.Header>
+                        <Label 
+                            Content="Остановки"
+                            FontSize="14">
+                        </Label>
+                    </TabItem.Header>
+                    <Grid>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="70*"/>
+                            <RowDefinition Height="9*"/>
+                        </Grid.RowDefinitions>
+                        <DataGrid
+                            Name="PointsListDataGrid" 
+                            AutoGenerateColumns="False" 
+                            VerticalAlignment="Stretch" 
+                            HorizontalAlignment="Stretch"
+                            Margin="-3,-3,-3,0"
+                            Grid.Row="0">
+                            <DataGrid.ItemContainerStyle>
+                                <Style TargetType="DataGridRow">
+                                    <EventSetter 
+                                        Event="MouseDoubleClick" 
+                                        Handler="DataGridRow_MouseDoubleClick"/>
+                                </Style>
+                            </DataGrid.ItemContainerStyle>
+                            <DataGrid.Columns>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Points.IdPoint}" 
+                                    Header="IdPoint"  
+                                    Width="100" 
+                                    IsReadOnly="True"/>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Points.Name}" 
+                                    Header="Name" 
+                                    Width="100" 
+                                    IsReadOnly="True"/>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Points.location}" 
+                                    Header="location" 
+                                    Width="100"
+                                    IsReadOnly="True"/>
+                            </DataGrid.Columns>
+                        </DataGrid>
+                        <StackPanel 
+                            Orientation="Horizontal"
+                            Grid.Row="1">
+                            <Button
+                            Content="Добавить"
+                            Width="90"
+                            Height="30"
+                            Margin="0,0,10,0">
+                            </Button>
+                            <Button
+                            Content="Удалить"
+                            Grid.Row="1"
+                            Width="90"
+                            Height="30">
+                            </Button>
+                        </StackPanel>
+                    </Grid>
+                </TabItem>
+                <TabItem 
+                Height="30" 
+                Width="120">
+                    <TabItem.Header>
+                        <Label 
+                            Content="Водители"
+                            FontSize="14">
+                        </Label>
+                    </TabItem.Header>
+                    <Grid>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="70*"/>
+                            <RowDefinition Height="9*"/>
+                        </Grid.RowDefinitions>
+                        <DataGrid
+                            Name="DriversListDataGrid" 
+                            AutoGenerateColumns="False" 
+                            VerticalAlignment="Stretch" 
+                            HorizontalAlignment="Stretch"
+                            Margin="-3,-3,-3,0"
+                            Grid.Row="0">
+                            <DataGrid.ItemContainerStyle>
+                                <Style TargetType="DataGridRow">
+                                    <EventSetter 
+                                        Event="MouseDoubleClick" 
+                                        Handler="DataGridRow_MouseDoubleClick"/>
+                                </Style>
+                            </DataGrid.ItemContainerStyle>
+                            <DataGrid.Columns>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Drivers.IdDriver}" 
+                                    Header="Номер"  
+                                    Width="100" 
+                                    IsReadOnly="True"/>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Drivers.IdTransport}" 
+                                    Header="Name" 
+                                    Width="100" 
+                                    IsReadOnly="True"/>
+                                <DataGridTextColumn 
+                                    Binding="{Binding Points.location}" 
+                                    Header="location" 
+                                    Width="100"
+                                    IsReadOnly="True"/>
+                            </DataGrid.Columns>
+                        </DataGrid>
+                        <StackPanel 
+                            Orientation="Horizontal"
+                            Grid.Row="1">
+                            <Button
+                            Content="Добавить"
+                            Width="90"
+                            Height="30"
+                            Margin="0,0,10,0">
+                            </Button>
+                            <Button
+                            Content="Удалить"
+                            Grid.Row="1"
+                            Width="90"
+                            Height="30">
+                            </Button>
+                        </StackPanel>
+                    </Grid>
+                </TabItem>
+            </TabControl>
+        </Grid>
+
+
+
     </Grid>
 </Window>

+ 3 - 3
Kusach/TestRouteEditWindow.xaml.cs

@@ -36,9 +36,9 @@ namespace Kusach
 
         private void Button_Click(object sender, RoutedEventArgs e)
         {
-            TestWindow tw = new TestWindow();
-            tw.Show();
-            this.Close();
+            //TestWindow tw = new TestWindow();
+            //tw.Show();
+            //this.Close();
         }
     }
 }

+ 0 - 59
Kusach/TestWindow.xaml

@@ -1,59 +0,0 @@
-<Window x:Class="Kusach.TestWindow"
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:Kusach"
-        mc:Ignorable="d"
-        Title="TestWindow" Height="450" Width="800">
-    <Grid>
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="137*"/>
-            <ColumnDefinition Width="655*"/>
-        </Grid.ColumnDefinitions>
-        <Grid Grid.Column="0">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="189*"/>
-                <RowDefinition Height="230*"/>
-            </Grid.RowDefinitions>
-            <TextBox
-                Name="SearchBox"
-                Grid.Row="0"
-                Text="">
-            </TextBox>
-            <Button
-                Content="Найти"
-                Grid.Row="1" 
-                Click="Find_Click">
-            </Button>
-        </Grid>
-        <DataGrid 
-            Name="RoutesList" 
-            Grid.Column="1"
-            AutoGenerateColumns="False" 
-            Height="419" 
-            VerticalAlignment="Top" 
-            HorizontalAlignment="Center" 
-            Width="655" Grid.RowSpan="2">
-            <DataGrid.ItemContainerStyle>
-                <Style TargetType="DataGridRow">
-                    <EventSetter 
-                        Event="MouseDoubleClick" 
-                        Handler="DataGridRow_MouseDoubleClick"/>
-                </Style>
-            </DataGrid.ItemContainerStyle>
-            <DataGrid.Columns>
-                <DataGridTextColumn 
-                    Binding="{Binding IdRoute}" 
-                    Header="IdRoute"  
-                    Width="100" 
-                    IsReadOnly="True"/>
-                <DataGridTextColumn 
-                    Binding="{Binding Name}" 
-                    Header="Name" 
-                    Width="100"
-                    IsReadOnly="True"/>
-            </DataGrid.Columns>
-        </DataGrid>
-    </Grid>
-</Window>

+ 0 - 43
Kusach/TestWindow.xaml.cs

@@ -1,43 +0,0 @@
-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.Shapes;
-
-namespace Kusach
-{
-    /// <summary>
-    /// Логика взаимодействия для TestWindow.xaml
-    /// </summary>
-    public partial class TestWindow : Window
-    {
-        public TestWindow()
-        {
-            InitializeComponent();
-            RoutesList.ItemsSource = cnt.db.Routes.ToList();
-        }
-
-        private void DataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
-        {
-            TestRouteEditWindow trew = new TestRouteEditWindow(((Routes)RoutesList.SelectedItem).IdRoute);
-            trew.Show();
-            this.Close();
-        }
-
-        private void Find_Click(object sender, RoutedEventArgs e)
-        {
-            if(SearchBox.Text != "")
-                RoutesList.ItemsSource = cnt.db.Routes.Where(item => (item.IdRoute + " " + item.Name).Contains(SearchBox.Text)).ToList();
-            else
-                RoutesList.ItemsSource = cnt.db.Routes.ToList();
-        }
-    }
-}