Explorar o código

Добавил окно, заполнил окно

gr682_bpv %!s(int64=4) %!d(string=hai) anos
pai
achega
dc58080bf1

+ 7 - 0
HotelCalifornia/HotelCalifornia.csproj

@@ -63,6 +63,9 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="Variant.xaml.cs">
+      <DependentUpon>Variant.xaml</DependentUpon>
+    </Compile>
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -75,6 +78,10 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="Variant.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">

+ 9 - 8
HotelCalifornia/MainWindow.xaml

@@ -19,27 +19,28 @@
         <Image HorizontalAlignment="Left" Height="57" Margin="96,15,0,0" VerticalAlignment="Top" Width="183" Source="Image/5star.png"/>
         <Image HorizontalAlignment="Left" Height="62" Margin="319,177,0,0" VerticalAlignment="Top" Width="63" Source="Image/cir2.png"/>
         <Image HorizontalAlignment="Left" Height="62" Margin="319,177,0,0" VerticalAlignment="Top" Width="63" Source="Image/h1.png"/>
-        <Button
-                Background="#7E42F5"
-    materialDesign:ButtonAssist.CornerRadius="25"
-    ToolTip="Вход" Margin="458,289,91,60" Height="Auto" Click="Vhod">
-            <TextBlock Text="Войти" />
-        </Button>
+       
         <StackPanel HorizontalAlignment="Left" Height="206" Margin="404,88,0,0" VerticalAlignment="Top" Width="258">
             <Label Content="Авторизация" Margin="0,0,0,0" Foreground="White" FontSize="18" FontFamily="Century Gothic" HorizontalAlignment="Center"/>
             <Label Content="Логин:" Margin="0,10,0,0" Foreground="White" FontSize="18" FontFamily="Century Gothic"/>
             <StackPanel Orientation="Horizontal">
                 <materialDesign:PackIcon Kind="User" Width="30" Height="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                <TextBox Name="logintxt" Margin="0,0,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="White"
+                <TextBox Name="logintxt" Margin="0,0,0,0" FontSize="18" FontFamily="Century Gothic" Foreground="White" MaxLength="10"
   materialDesign:HintAssist.Hint="Введите логин" Width="227"/>
             </StackPanel>
             <Label Content="Пароль:" Margin="0,10,0,0" Foreground="White" FontSize="18" FontFamily="Century Gothic"/>
             <StackPanel Orientation="Horizontal">
                 <materialDesign:PackIcon Kind="Password" Width="30" Height="30" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                <PasswordBox Name="passwordtxt" materialDesign:HintAssist.Hint="Введите пароль" Foreground="White" FontSize="18" FontFamily="Century Gothic"  HorizontalAlignment="Center" Margin="0,5,0,0" Width="226"/>
+                <PasswordBox Name="passwordtxt"   materialDesign:HintAssist.Hint="Введите пароль" Foreground="White" FontSize="18" FontFamily="Century Gothic"  HorizontalAlignment="Center" Margin="0,5,0,0" Width="226" MaxLength="10"/>
             </StackPanel>
         </StackPanel>
         <Button
+                Background="#7E42F5"
+    materialDesign:ButtonAssist.CornerRadius="25"
+    ToolTip="Вход" Margin="458,299,91,50" Height="Auto" Click="Vhod">
+            <TextBlock Text="Войти" />
+        </Button>
+        <Button
   Style="{StaticResource MaterialDesignIconButton}"
   ToolTip="Выход из приложения" Margin="642,10,10,342" Click="Close">
             <materialDesign:PackIcon

+ 8 - 3
HotelCalifornia/MainWindow.xaml.cs

@@ -22,9 +22,9 @@ namespace HotelCalifornia
     {
         public MainWindow()
         {
-            InitializeComponent();
+            InitializeComponent();        
         }
-
+        Variant variant = new Variant();
         private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
         {
             DragMove();
@@ -38,7 +38,7 @@ namespace HotelCalifornia
                 case MessageBoxResult.Yes:
                     Application.Current.Shutdown();
                     break;
-                case MessageBoxResult.No:                   
+                case MessageBoxResult.No:         
                     break;
             }                 
         }
@@ -49,6 +49,11 @@ namespace HotelCalifornia
             {
                 MessageBox.Show("Поля не могут быть пустыми!", "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Information);
             }
+            else
+            {
+                this.Close();
+                variant.Show();
+            }
         }
     }
 }

+ 59 - 0
HotelCalifornia/Variant.xaml

@@ -0,0 +1,59 @@
+<Window x:Class="HotelCalifornia.Variant"
+        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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+        xmlns:local="clr-namespace:HotelCalifornia"
+        mc:Ignorable="d"
+        Title="Variant" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" Icon="image/h1.png">
+    <Grid>
+        <Grid.Background>
+            <LinearGradientBrush StartPoint="0.1,0" EndPoint="0.9,1">
+                <GradientStop Color="#7E42F5" Offset="1" />
+                <GradientStop Color="#383E7A" Offset="0"/>
+            </LinearGradientBrush>
+        </Grid.Background>
+        <Label Content="Выберите нужную функцию" Foreground="White" FontSize="35" FontFamily="Century Gothic" HorizontalAlignment="Center" Margin="148,54,148,336.6"/>
+        <Label Content="Комнаты" Foreground="White" FontSize="20" FontFamily="Century Gothic" HorizontalAlignment="Center" Margin="100,272,604,143.6"/>
+        <Label Content="Работники" Foreground="White" FontSize="20" FontFamily="Century Gothic" HorizontalAlignment="Center" Margin="266,272,418,143.6" Width="116"/>
+        <Label Content="Клиенты" Foreground="White" FontSize="20" FontFamily="Century Gothic" HorizontalAlignment="Center" Margin="454,272,253,143.6" Width="93"/>
+        <Label Content="Резервирование" Foreground="White" FontSize="20" FontFamily="Century Gothic" HorizontalAlignment="Center" Margin="586,272,33,143.6" Width="181"/>
+        <StackPanel Orientation="Horizontal" Margin="0,172,0,159.6" HorizontalAlignment="Center" VerticalAlignment="Center" Width="800" Height="118">
+            <Button
+  Style="{StaticResource MaterialDesignFloatingActionLightButton}" Margin="120,0,0,0">
+                <materialDesign:PackIcon
+    Kind="Door"
+    Height="35"
+    Width="35" />
+            </Button>
+            <Button
+  Style="{StaticResource MaterialDesignFloatingActionLightButton}" Margin="120,0,0,0">
+                <materialDesign:PackIcon
+    Kind="Work"
+    Height="35"
+    Width="35" />
+            </Button>
+            <Button
+  Style="{StaticResource MaterialDesignFloatingActionLightButton}" Margin="120,0,0,0">
+                <materialDesign:PackIcon
+    Kind="user"
+    Height="35"
+    Width="35" />
+            </Button>
+            <Button
+  Style="{StaticResource MaterialDesignFloatingActionLightButton}" Margin="120,0,0,0">
+                <materialDesign:PackIcon
+    Kind="BagSuitcase"
+    Height="35"
+    Width="35" />
+            </Button>
+        </StackPanel>
+        <Button
+  Style="{StaticResource MaterialDesignIconButton}"
+  ToolTip="Выход из приложения" Margin="742,10,10,391.6" Click="Close">
+            <materialDesign:PackIcon
+    Kind="ExitToApp" Foreground="White"/>
+        </Button>
+    </Grid>
+</Window>

+ 40 - 0
HotelCalifornia/Variant.xaml.cs

@@ -0,0 +1,40 @@
+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 HotelCalifornia
+{
+    /// <summary>
+    /// Логика взаимодействия для Variant.xaml
+    /// </summary>
+    public partial class Variant : Window
+    {
+        public Variant()
+        {
+            InitializeComponent();
+        }
+
+        private void Close(object sender, RoutedEventArgs e)
+        {
+            MessageBoxResult result = MessageBox.Show("Вы хотите выйти из приложения?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
+            switch (result)
+            {
+                case MessageBoxResult.Yes:
+                    Application.Current.Shutdown();
+                    break;
+                case MessageBoxResult.No:
+                    break;
+            }
+        }
+    }
+}