Imagara 2 lat temu
rodzic
commit
1c7752aefd

+ 1 - 1
RaspisKusach/EDM.edmx.diagram

@@ -13,7 +13,7 @@
         <EntityTypeShape EntityType="RouteScheduleDataBaseModel.Tickets" Width="1.5" PointX="9.625" PointY="3.5" />
         <EntityTypeShape EntityType="RouteScheduleDataBaseModel.Trains" Width="1.5" PointX="14.625" PointY="6.875" />
         <EntityTypeShape EntityType="RouteScheduleDataBaseModel.Trips" Width="1.5" PointX="12.25" PointY="3.875" />
-        <EntityTypeShape EntityType="RouteScheduleDataBaseModel.Users" Width="1.5" PointX="9.5" PointY="7.125" />
+        <EntityTypeShape EntityType="RouteScheduleDataBaseModel.Users" Width="1.5" PointX="9.625" PointY="6.875" />
         <AssociationConnector Association="RouteScheduleDataBaseModel.FK_Carriages_Trains" />
         <AssociationConnector Association="RouteScheduleDataBaseModel.FK_Tickets_Carriages" />
         <AssociationConnector Association="RouteScheduleDataBaseModel.FK_RoutesStations_Routes" />

+ 1 - 1
RaspisKusach/ErrorWindow.xaml

@@ -12,7 +12,7 @@
         WindowStartupLocation="CenterScreen" 
         WindowStyle="None" 
         ResizeMode="NoResize">
-    <Border Background="{StaticResource Color2}"
+    <Border Background="{StaticResource ItemColor}"
             MouseDown="Border_MouseDown">
         <StackPanel>
             <TextBlock Name="ErrorLabel" 

+ 3 - 2
RaspisKusach/Pages/AdministrationPage.xaml

@@ -5,8 +5,9 @@
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800"
-      Title="AdministrationPage">
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Администратор">
 
     <Grid Background="White">
         <Grid.RowDefinitions>

+ 5 - 3
RaspisKusach/Pages/LoginPage.xaml

@@ -5,8 +5,10 @@
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       mc:Ignorable="d"
-      d:DesignHeight="450" 
-      d:DesignWidth="800">
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Вход">
+    
     <Grid>
         <Grid.ColumnDefinitions>
             <ColumnDefinition/>
@@ -15,7 +17,7 @@
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition/>
-            <RowDefinition Height="4*"/>
+            <RowDefinition Height="8*"/>
             <RowDefinition/>
         </Grid.RowDefinitions>
         <Image Source="/Resources/BackGround.jpg" 

+ 4 - 2
RaspisKusach/Pages/MenuPage.xaml

@@ -5,8 +5,10 @@
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       mc:Ignorable="d" 
-      d:DesignHeight="450" 
-      d:DesignWidth="800">
+      d:DesignHeight="417" 
+      d:DesignWidth="792"
+      Title="Меню">
+    
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition/>

+ 15 - 10
RaspisKusach/Pages/ProfilePage.xaml

@@ -4,10 +4,14 @@
       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
+      xmlns:math="http://hexinnovation.com/math"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800"
-      Title="ProfilePage">
-
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Профиль">
+    <Page.Resources>
+        <math:MathConverter x:Key="math"/>
+    </Page.Resources>
     <Grid Background="White">
         <StackPanel>
             <Label>
@@ -16,7 +20,6 @@
             <ListBox Name="TicketsListBox"
                  Grid.Row="1"
                  Margin="10,0,10,0"
-                 Background="{StaticResource Color2}"
                  BorderBrush="{x:Null}"
                  SelectionChanged="TicketsListBox_SelectionChanged"
                  ScrollViewer.HorizontalScrollBarVisibility="Disabled"
@@ -24,12 +27,14 @@
                 <ScrollBar></ScrollBar>
                 <ListBox.ItemTemplate>
                     <DataTemplate>
-                        <Border Width="{Binding Path=ActualWidth, ElementName=TicketsListBox}"
-                            Margin="-10,0,0,0"
-                            Height="70"
-                            CornerRadius="10"
-                            Background="{StaticResource Color2}">
-                            <Grid>
+                        <Border Width="{Binding Path=ActualWidth, Mode=OneWay, ElementName=TicketsListBox, Converter={StaticResource math}, ConverterParameter=x-15}"
+                                CornerRadius="15"
+                                Height="70"
+                                Background="{StaticResource ItemColor}"
+                                BorderThickness="1.5"
+                                BorderBrush="Black"
+                                Style="{StaticResource IsBorderMouseOver}">
+                            <Grid Margin="7">
                                 <StackPanel Orientation="Horizontal">
                                     <Image Width="30"
                                Height="30"

+ 4 - 2
RaspisKusach/Pages/RegisterPage.xaml

@@ -5,7 +5,9 @@
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800">
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Регистрация">
 
     <Grid>
         <Grid.ColumnDefinitions>
@@ -15,7 +17,7 @@
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition/>
-            <RowDefinition Height="2.75*"/>
+            <RowDefinition Height="8*"/>
             <RowDefinition/>
         </Grid.RowDefinitions>
         <Image Source="/Resources/BackGround.jpg" 

+ 8 - 3
RaspisKusach/Pages/SchedulePage.xaml

@@ -6,8 +6,10 @@
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       xmlns:math="http://hexinnovation.com/math"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800"
-      Title="SchedulePage">
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Расписание">
+    
     <Page.Resources>
         <math:MathConverter x:Key="math"/>
     </Page.Resources>
@@ -55,7 +57,10 @@
                     <Border Width="{Binding Path=ActualWidth, Mode=OneWay, ElementName=TripsListBox, Converter={StaticResource math}, ConverterParameter=x-15}"
                             Height="70"
                             CornerRadius="15"
-                            Background="{StaticResource Color2}">
+                            BorderThickness="1.5"
+                            BorderBrush="Black"
+                            Style="{StaticResource IsBorderMouseOver}"
+                            Background="{StaticResource ItemColor}">
                         <Grid Background="{x:Null}">
                             <Grid.ColumnDefinitions>
                                 <ColumnDefinition Width="0.53*"/>

+ 9 - 8
RaspisKusach/Pages/SearchForTicketsPage.xaml

@@ -6,9 +6,9 @@
       xmlns:local="clr-namespace:RaspisKusach.Pages"
       xmlns:math="http://hexinnovation.com/math"
       mc:Ignorable="d" 
-      d:DesignHeight="450" 
-      d:DesignWidth="800"
-      Title="MainPage">
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Поиск билета">
     <Page.Resources>
         <math:MathConverter x:Key="math"/>
     </Page.Resources>
@@ -20,7 +20,7 @@
 
         <!--LEFTBAR-->
         <Border CornerRadius="15" 
-                Background="{StaticResource Color2}"
+                Background="{StaticResource ItemColor}"
                 BorderThickness="1.5"
                 BorderBrush="{StaticResource Selection}"
                 Margin="5"
@@ -81,12 +81,13 @@
                     <Border Height="120"
                             Width="{Binding Path=ActualWidth, Mode=OneWay, ElementName=ListBox, Converter={StaticResource math}, ConverterParameter=x-15}"
                             CornerRadius="10"
-                            Background="{StaticResource Color2}"
+                            Background="{StaticResource ItemColor}"
                             BorderThickness="1.5"
-                            BorderBrush="{StaticResource Selection}"
+                            BorderBrush="Black"
+                            Style="{StaticResource IsBorderMouseOver}"
                             Margin="0,2,0,2">
 
-                        <Grid>
+                        <Grid Margin="7">
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="40"/>
                                 <RowDefinition/>
@@ -130,7 +131,7 @@
                                 </StackPanel>
                             </Grid>
 
-                            <!--DOWNLEFT-->
+                            <!--DOWN-->
                             <Grid Grid.Row="1" Grid.Column="0"
                                   Background="{x:Null}">
                                 <Grid Background="{x:Null}">

+ 128 - 28
RaspisKusach/Pages/TripInfoPage.xaml

@@ -4,45 +4,145 @@
       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:RaspisKusach.Pages"
+      xmlns:math="http://hexinnovation.com/math"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800"
-      Title="TripInfoPage">
-
+      d:DesignHeight="367" 
+      d:DesignWidth="792"
+      Title="Информация о поездке">
+    <Page.Resources>
+        <math:MathConverter x:Key="math"/>
+    </Page.Resources>
+    
     <Grid Background="White">
         <Grid.RowDefinitions>
-            <RowDefinition/>
-            <RowDefinition Height="2*"/>
+            <RowDefinition Height="139*"/>
+            <RowDefinition Height="228*"/>
         </Grid.RowDefinitions>
         <!--UP-->
-        <Grid>
-            <Grid.RowDefinitions>
-                <RowDefinition Height="33*"/>
-                <RowDefinition Height="38*"/>
-                <RowDefinition Height="79*"/>
-            </Grid.RowDefinitions>
-            <StackPanel Orientation="Horizontal">
-                <Image Source="/RaspisKusach;component/Resources/Train.png" >
-
-                </Image>
-                <Label>
-                    ПОЕЗД  #123
-                </Label>
-            </StackPanel>
-
-            <Label Grid.Row="1"
-                   Name="Direction"
-                   HorizontalContentAlignment="Left"/>
-
-            <Grid Grid.Row="2">
+        <Border Background="{StaticResource ItemColor}"
+                CornerRadius="15"
+                BorderThickness="1.5"
+                BorderBrush="{StaticResource Selection}"
+                Margin="5">
+            <Grid Margin="7">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="9*"/>
+                    <RowDefinition Height="9*"/>
+                    <RowDefinition Height="24*"/>
+                </Grid.RowDefinitions>
+                <StackPanel Orientation="Horizontal">
+                    <Image Source="/RaspisKusach;component/Resources/Train.png" />
+                    <Label Content="ПОЕЗД  #123"/>
+                </StackPanel>
+
+                <Label Grid.Row="1"
+                       Name="Direction"
+                       Style="{x:Null}"
+                       Content="Томск1 - Томск1 - Томск1 - Томск1 - Томск1"/>
+
+                <!--DOWN-->
+                <Grid Grid.Row="2"
+                      Background="{x:Null}">
+                    <Grid Background="{x:Null}">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <StackPanel VerticalAlignment="Center">
+                            <Label Content="Tomsk"/>
+                            <Label Content="27.08.2022 16:30"/>
+                        </StackPanel>
+
+                        <Label Grid.Column="1"
+                               Content="15:30"
+                               VerticalAlignment="Center">
+                        </Label>
+
+                        <StackPanel Grid.Column="2"
+                                    VerticalAlignment="Center">
+                            <Label Content="Tomsk"/>
+                            <Label Content="27.08.2022 16:30"/>
+                        </StackPanel>
+                    </Grid>
+                </Grid>
 
             </Grid>
+        </Border>
 
-        </Grid>
 
         <!--DOWN-->
-        <Grid Grid.Row="1">
+        <ListBox Name="ListBox"
+                 Grid.Row="1"
+                 BorderBrush="{x:Null}"
+                 ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+            temp
+            <ListBox.ItemTemplate>
+                <DataTemplate>
+                    <Border Height="120"
+                            Width="{Binding Path=ActualWidth, Mode=OneWay, ElementName=ListBox, Converter={StaticResource math}, ConverterParameter=x-15}"
+                            CornerRadius="10"
+                            Background="{StaticResource ItemColor}"
+                            Margin="0,2,0,2"
+                            BorderThickness="1.5"
+                            BorderBrush="Black"
+                            Style="{StaticResource IsBorderMouseOver}">
+
+                        <Grid Margin="7">
+                            <Grid.RowDefinitions>
+                                <RowDefinition Height="40"/>
+                                <RowDefinition/>
+                            </Grid.RowDefinitions>
+
+                            <!--UP-->
+                            <StackPanel Orientation="Horizontal">
+                                <Image Width="35"
+                                       Height="35"
+                                       Margin="5"
+                                       HorizontalAlignment="Left"
+                                       Source="/RaspisKusach;component/Resources/Сarriage.png">
+                                </Image>
+                                <Label Content="Вагон #2"/>
+                            </StackPanel>
+
+                            <!--DOWN-->
+                            <Grid Grid.Row="1" Grid.Column="0"
+                                  Background="{x:Null}">
+                                <Grid Background="{x:Null}">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition/> 
+                                        <ColumnDefinition/>
+                                        <ColumnDefinition/>
+                                    </Grid.ColumnDefinitions>
+
+                                    <StackPanel>
+                                        <Label Content="{Binding stationDeparture}">
+                                        </Label>
+                                        <Label Content="{Binding timeDeparture}">
+                                        </Label>
+                                    </StackPanel>
+
+                                    <Label Content="{Binding timeBetween}" 
+                                           Grid.Column="1">
+                                    </Label>
+
+                                    <StackPanel Grid.Column="2">
+                                        <Label Content="{Binding stationArrival}">
+
+                                        </Label>
+                                        <Label Content="{Binding timeArrival}">
 
-        </Grid>
+                                        </Label>
+                                    </StackPanel>
+                                </Grid>
+                            </Grid>
+                        </Grid>
+                    </Border>
+                </DataTemplate>
+            </ListBox.ItemTemplate>
+        </ListBox>
+        
 
     </Grid>
 

+ 1 - 0
RaspisKusach/Pages/TripInfoPage.xaml.cs

@@ -23,6 +23,7 @@ namespace RaspisKusach.Pages
             string stationsList = "";
             foreach (RoutesStations rs in cnt.db.RoutesStations.Where(item => item.IdRoute == trip.IdRoute))
                 stationsList += rs.Stations.Location == Functions.GetDepartureStationLocation(trip) ? rs.Stations.Name : $"{rs.Stations.Name} → ";
+
             Direction.Content = stationsList;
 
         }

+ 1 - 1
RaspisKusach/RaspisKusach.csproj

@@ -125,7 +125,6 @@
     <Compile Include="Stations.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
-    <Compile Include="Styles\Style.cs" />
     <Compile Include="sysdiagrams.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
@@ -243,6 +242,7 @@
       <DependentUpon>EDM.edmx</DependentUpon>
       <LastGenOutput>EDM.cs</LastGenOutput>
     </Content>
+    <Resource Include="Resources\Сarriage.png" />
     <Resource Include="Resources\Train.png" />
     <Resource Include="Resources\Background.jpg" />
   </ItemGroup>

BIN
RaspisKusach/Resources/Сarriage.png


+ 0 - 20
RaspisKusach/Styles/Style.cs

@@ -1,20 +0,0 @@
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Input;
-
-namespace RaspisKusach
-{
-    public partial class Style : ResourceDictionary
-    {
-        private void MouseEnter(object sender, MouseEventArgs e)
-        {
-            ((Border)sender).BorderBrush = new SolidColorBrush(Color.FromRgb(0x8B, 0x00, 0xFF));
-        }
-
-        private void MouseLeave(object sender, MouseEventArgs e)
-        {
-            ((Border)sender).BorderBrush = new SolidColorBrush(Color.FromRgb(0x00, 0x00, 0x00));
-        }
-    }
-}

+ 67 - 26
RaspisKusach/Styles/Style.xaml

@@ -1,7 +1,5 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    x:Class="RaspisKusach.Style">
-    
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     
     <SolidColorBrush x:Key="TextColor" 
                      Color="Black">
@@ -11,54 +9,97 @@
                      Color="#8B00FF">
     </SolidColorBrush>
     
-    <SolidColorBrush x:Key="Color1" 
-                     Color="#D2B18E">
-    </SolidColorBrush>
 
-    <SolidColorBrush x:Key="Color2" 
+    <SolidColorBrush x:Key="ItemColor" 
                      Color="#BBBBBF">
     </SolidColorBrush>
 
-    <SolidColorBrush x:Key="Color3" 
-                     Color="#827B72">
-    </SolidColorBrush>
-    
-    <SolidColorBrush x:Key="Color4" 
-                     Color="#494450">
-    </SolidColorBrush>
-    
-    <SolidColorBrush x:Key="Color5" 
-                     Color="#392570">
-    </SolidColorBrush>
-
 
     <Style TargetType="Label">
         <Setter Property="HorizontalContentAlignment" Value="Center"/>
         <Setter Property="VerticalContentAlignment" Value="Center"/>
         <Setter Property="Foreground" Value="Black"/>
     </Style>
+    
+
+    <Style TargetType="ListBoxItem">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="ListBoxItem">
+                    <Border>
+                        <ContentPresenter />
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 
+    <Style TargetType="Border"
+           x:Key="IsBorderMouseOver">
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Trigger.EnterActions>
+                    <BeginStoryboard>
+                        <Storyboard>
+                            <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color"
+                                            To="#8B00FF"
+                                            Duration="0:0:0.25"/>
+                        </Storyboard>
+                    </BeginStoryboard>
+                </Trigger.EnterActions>
+                <Trigger.ExitActions>
+                    <BeginStoryboard>
+                        <Storyboard>
+                            <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color"
+                                            To="Black"
+                                            Duration="0:0:0.25"/>
+                        </Storyboard>
+                    </BeginStoryboard>
+                </Trigger.ExitActions>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    
     <Style TargetType="Button">
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="Button">
-                    <Border Name="Border" 
+                    <Border Name="border" 
                             CornerRadius="10"
                             Background="White"
                             BorderBrush="Black"
-                            BorderThickness="1.3"
-                            MouseEnter="MouseEnter" 
-                            MouseLeave="MouseLeave">
+                            BorderThickness="1.3">
                         <ContentPresenter HorizontalAlignment="Center" 
                                           VerticalAlignment="Center"/>
                     </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Trigger.EnterActions>
+                                <BeginStoryboard>
+                                    <Storyboard>
+                                        <ColorAnimation Storyboard.TargetName="border"
+                                                        Storyboard.TargetProperty="BorderBrush.Color"
+                                                        To="#8B00FF"
+                                                        Duration="0:0:0.25"/>
+                                    </Storyboard>
+                                </BeginStoryboard>
+                            </Trigger.EnterActions>
+                            <Trigger.ExitActions>
+                                <BeginStoryboard>
+                                    <Storyboard>
+                                        <ColorAnimation Storyboard.TargetName="border"
+                                                        Storyboard.TargetProperty="BorderBrush.Color"
+                                                        To="Black"
+                                                        Duration="0:0:0.25"/>
+                                    </Storyboard>
+                                </BeginStoryboard>
+                            </Trigger.ExitActions>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
         <Setter Property="Foreground" Value="{StaticResource TextColor}"/>
     </Style>
-    
-    
-    
 
 </ResourceDictionary>