-DSG 2 年 前
コミット
406415e4ee

+ 2 - 1
RaspisKusach/MainWindow.xaml

@@ -68,7 +68,8 @@
         </Border>
         </Border>
         <Frame Name="MainFrame"
         <Frame Name="MainFrame"
                Grid.Row="1"
                Grid.Row="1"
-               NavigationUIVisibility="Hidden" >
+               NavigationUIVisibility="Hidden" 
+               Source="/Pages/MenuPage.xaml">
         </Frame>
         </Frame>
     </Grid>
     </Grid>
 </Window>
 </Window>

+ 0 - 1
RaspisKusach/MainWindow.xaml.cs

@@ -8,7 +8,6 @@ namespace RaspisKusach
         public MainWindow()
         public MainWindow()
         {
         {
             InitializeComponent();
             InitializeComponent();
-            MainFrame.Content = new Pages.LoginPage();
         }
         }
         private void Border_MouseDown(object sender, MouseButtonEventArgs e)
         private void Border_MouseDown(object sender, MouseButtonEventArgs e)
         {
         {

+ 5 - 2
RaspisKusach/Pages/LoginPage.xaml.cs

@@ -34,7 +34,10 @@ namespace RaspisKusach.Pages
         private void LogButton_Click(object sender, RoutedEventArgs e)
         private void LogButton_Click(object sender, RoutedEventArgs e)
         {
         {
             if (Test)
             if (Test)
-                NavigationService.Navigate(new Pages.MainPage());
+            {
+                Session.User = cnt.db.Users.Where(item => item.IdUser == 1).FirstOrDefault();
+                NavigationService.Navigate(new MenuPage());
+            }
             else
             else
             {
             {
                 try
                 try
@@ -46,7 +49,7 @@ namespace RaspisKusach.Pages
                     else
                     else
                     {
                     {
                         //Profile.userId = cnt.db.User.Where(item => item.NickName == LogBox.Text).Select(item => item.Id).FirstOrDefault();
                         //Profile.userId = cnt.db.User.Where(item => item.NickName == LogBox.Text).Select(item => item.Id).FirstOrDefault();
-                        NavigationService.Navigate(new Pages.MainPage());
+                        NavigationService.Navigate(new MenuPage());
                     }
                     }
                 }
                 }
                 catch
                 catch

+ 9 - 5
RaspisKusach/Pages/MenuPage.xaml

@@ -14,7 +14,8 @@
         </Grid.RowDefinitions>
         </Grid.RowDefinitions>
         <Frame Name="MainContentFrame"
         <Frame Name="MainContentFrame"
                Grid.Row="0"
                Grid.Row="0"
-               NavigationUIVisibility="Hidden" >
+               NavigationUIVisibility="Hidden" 
+               Source="/Pages/MainPage.xaml" >
         </Frame>
         </Frame>
         <StackPanel Grid.Row="1"
         <StackPanel Grid.Row="1"
                     Orientation="Horizontal"
                     Orientation="Horizontal"
@@ -22,17 +23,20 @@
             <Button Width="120"
             <Button Width="120"
                     Height="40"
                     Height="40"
                     Content="Купить билет"
                     Content="Купить билет"
-                    Margin="10,0,10,0">
+                    Margin="10,0,10,0"
+                    Click="BuyTicketButton_Click">
             </Button>
             </Button>
             <Button Width="120"
             <Button Width="120"
                     Height="40"
                     Height="40"
                     Content="Расписание"
                     Content="Расписание"
-                    Margin="10,0,10,0">
+                    Margin="10,0,10,0"
+                    Click="ScheduleButton_Click">
             </Button>
             </Button>
             <Button Width="120"
             <Button Width="120"
                     Height="40"
                     Height="40"
-                    Content="Войти(Профиль)"
-                    Margin="10,0,10,0">
+                    Content="Профиль"
+                    Margin="10,0,10,0"
+                    Click="ProfileButton_Click">
             </Button>
             </Button>
         </StackPanel>
         </StackPanel>
     </Grid>
     </Grid>

+ 16 - 0
RaspisKusach/Pages/MenuPage.xaml.cs

@@ -24,5 +24,21 @@ namespace RaspisKusach.Pages
         {
         {
             InitializeComponent();
             InitializeComponent();
         }
         }
+
+        private void BuyTicketButton_Click(object sender, RoutedEventArgs e)
+        {
+            MainContentFrame.Content = new SearchForTicketsPage();
+        }
+        private void ScheduleButton_Click(object sender, RoutedEventArgs e)
+        {
+            MainContentFrame.Content = new SchedulePage();
+        }
+        private void ProfileButton_Click(object sender, RoutedEventArgs e)
+        {
+            if(Session.User == null)
+                MainContentFrame.Content = new LoginPage();
+            else
+                MainContentFrame.Content = new ProfilePage();
+        }
     }
     }
 }
 }

+ 14 - 0
RaspisKusach/Pages/ProfilePage.xaml

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

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

+ 14 - 0
RaspisKusach/Pages/SchedulePage.xaml

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

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

+ 14 - 0
RaspisKusach/Pages/SearchForTicketsPage.xaml

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

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

+ 21 - 0
RaspisKusach/RaspisKusach.csproj

@@ -97,9 +97,18 @@
     <Compile Include="Pages\MenuPage.xaml.cs">
     <Compile Include="Pages\MenuPage.xaml.cs">
       <DependentUpon>MenuPage.xaml</DependentUpon>
       <DependentUpon>MenuPage.xaml</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="Pages\ProfilePage.xaml.cs">
+      <DependentUpon>ProfilePage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Pages\RegisterPage.xaml.cs">
     <Compile Include="Pages\RegisterPage.xaml.cs">
       <DependentUpon>RegisterPage.xaml</DependentUpon>
       <DependentUpon>RegisterPage.xaml</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="Pages\SchedulePage.xaml.cs">
+      <DependentUpon>SchedulePage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Pages\SearchForTicketsPage.xaml.cs">
+      <DependentUpon>SearchForTicketsPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Routes.cs">
     <Compile Include="Routes.cs">
       <DependentUpon>EDM.tt</DependentUpon>
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
     </Compile>
@@ -151,10 +160,22 @@
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
     </Page>
     </Page>
+    <Page Include="Pages\ProfilePage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Pages\RegisterPage.xaml">
     <Page Include="Pages\RegisterPage.xaml">
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
     </Page>
     </Page>
+    <Page Include="Pages\SchedulePage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Pages\SearchForTicketsPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\Style.xaml">
     <Page Include="Styles\Style.xaml">
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>

+ 3 - 6
RaspisKusach/Session.cs

@@ -1,12 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+using System.Linq;
 namespace RaspisKusach
 namespace RaspisKusach
 {
 {
     class Session
     class Session
     {
     {
+        public static Users User { get; set; }
+        public static Station ThisTableStation = cnt.db.Station.Where(item => item.IdStation == 1).FirstOrDefault();//cnt.db.Station.Where(item => item.Location == "Tomsk").FirstOrDefault();
     }
     }
 }
 }

+ 3 - 3
RaspisKusach/Styles/Style.xaml

@@ -4,7 +4,7 @@
     
     
     
     
     <SolidColorBrush x:Key="TextColor" 
     <SolidColorBrush x:Key="TextColor" 
-                     Color="#8B00FF">
+                     Color="Black">
     </SolidColorBrush>
     </SolidColorBrush>
 
 
     <SolidColorBrush x:Key="Selection" 
     <SolidColorBrush x:Key="Selection" 
@@ -47,8 +47,8 @@
                     <Border Name="Border" 
                     <Border Name="Border" 
                             CornerRadius="10"
                             CornerRadius="10"
                             Background="White"
                             Background="White"
-                            BorderBrush="LightGray"
-                            BorderThickness="1"
+                            BorderBrush="Black"
+                            BorderThickness="1.3"
                             MouseEnter="MouseEnter" 
                             MouseEnter="MouseEnter" 
                             MouseLeave="MouseLeave">
                             MouseLeave="MouseLeave">
                         <ContentPresenter HorizontalAlignment="Center" 
                         <ContentPresenter HorizontalAlignment="Center"