максим карбышев 2 anos atrás
pai
commit
bd519e3015

+ 8 - 0
Kinomaks/AddWindows/AddTimetableWindow.xaml.cs

@@ -49,6 +49,14 @@ namespace Kinomaks.AddWindows
                 return;
             }
 
+            if (Connection.db.Timetable.Select(item => item.Time + " " + item.Date + " " + item.Hall).Contains(timeResult + " " + dateResult + " " +
+                Connection.db.Hall.Where(item => item.Number == Convert.ToInt32(Hall.SelectedItem)).Select(item => item.ID).FirstOrDefault()))
+            {
+                ErrorWindow errorWindow = new ErrorWindow("зал уже занят");
+                errorWindow.Show();
+                return;
+            }
+
             Timetable timetable = new Timetable()
             {
                 Time = timeResult,

+ 1 - 1
Kinomaks/ElementsWindows/PaymentWindow.xaml

@@ -12,4 +12,4 @@
         <Label Content="К оплате:" HorizontalContentAlignment="Right" HorizontalAlignment="Left" Margin="507,0,0,0" VerticalAlignment="Center" Height="60" Width="252" Foreground="White" FontSize="36"/>
         <Label x:Name="ToPay" Content="" HorizontalAlignment="Left" Margin="762,0,0,0" VerticalAlignment="Center" Height="60" Width="364" Foreground="White" FontSize="36"/>
     </Grid>
-</Window>
+</Window>

+ 2 - 0
Kinomaks/ElementsWindows/PaymentWindow.xaml.cs

@@ -12,6 +12,7 @@ namespace Kinomaks.ElementsWindows
         int idFilm;
         List<int> numberOfSeats;
         int idTimetable;
+        string cheque;
 
         public PaymentWindow(int idFilm, List<int> numberOfSeats, int idTimetable)
         {
@@ -38,6 +39,7 @@ namespace Kinomaks.ElementsWindows
             this.Close();
         }
 
+
         private void BackButtonClick(object sender, RoutedEventArgs e)
         {
             PaymentMethod paymentMethod = new PaymentMethod(idFilm, numberOfSeats, idTimetable);

+ 1 - 1
Kinomaks/ElementsWindows/ReturnWindow.xaml

@@ -12,4 +12,4 @@
         <Button x:Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <Button x:Name="ReturnButton" Content="Вернуть" HorizontalAlignment="Center" Margin="0,792,0,0" VerticalAlignment="Top" Height="60" Width="180" FontSize="36" Click="ReturnButtonClick" />
     </Grid>
-</Window>
+</Window>

+ 1 - 11
Kinomaks/ElementsWindows/ReturnWindow.xaml.cs

@@ -1,16 +1,6 @@
 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 Kinomaks.ElementsWindows
 {
@@ -68,4 +58,4 @@ namespace Kinomaks.ElementsWindows
             this.Close();
         }
     }
-}
+}