コード例 #1
0
        public static User RegisterUser()
        {
            SelectUser newUser = new SelectUser();

            newUser.ShowDialog();
            return(newUser.currentUser);
        }
コード例 #2
0
        private void BuyButton_Click(object sender, RoutedEventArgs e)
        {
            if (!UserSingleton.GetInstance.IsAuthenticated)
            {
                SelectUser.RegisterUser();
            }

            if (UserSingleton.GetInstance.IsAuthenticated && CheckQuantity())
            {
                List <Seat> seatsVIP    = SeatsFactory.CreateSeats("VIP", VipQuantity.GetQuantity());
                List <Seat> seatsNormal = SeatsFactory.CreateSeats("Normal", NormalQuantity.GetQuantity());
                List <Seat> seatsECO    = SeatsFactory.CreateSeats("Eco", EcoQuantity.GetQuantity());

                List <Seat> seats = seatsVIP;
                seats.AddRange(seatsNormal);
                seats.AddRange(seatsECO);

                Reservation reservation = ReservationFactory.Create(_performance, seats);
                reservation.Save();

                ValidationOrder validationOrder = new ValidationOrder();
                this.Content = validationOrder;
            }
        }