public IActionResult Cancel(string name)
        {
            booking.CancelBooking(name);


            return(RedirectToAction(nameof(MyMovies)));
        }
Esempio n. 2
0
        public BookingDTO CancelBooking(Guid bookingId)
        {
            BookingManager bookingManager = new BookingManager();

            var bookingDto = bookingManager.CancelBooking(bookingId);

            return(bookingDto);
        }
Esempio n. 3
0
        public IActionResult CancelBooking(int id)
        {
            booking.CancelBooking(id);

            return(RedirectToAction(nameof(Booking)));
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Categories: ");
            category.GetAllCategories().ForEach(c =>
            {
                System.Console.WriteLine(c.Name);
            });


            System.Console.WriteLine("Movies: ");
            movie.GetAllMovies().ForEach(m =>
            {
                System.Console.WriteLine(m.Name, m.CategoryId, m.AvailableTime);
            });


            while (true)
            {
                System.Console.Write("Enter movies's name (or stop): ");
                string input = System.Console.ReadLine();

                if (input == "stop")
                {
                    break;
                }

                var movies = movie.CreateBooking(input);
                if (movies != null)
                {
                    System.Console.WriteLine($"Now you have a booking on {movies.Name} at {movies.AvailableTime}");
                }
                else
                {
                    System.Console.WriteLine("Movie is not available!");
                }
            }



            System.Console.WriteLine("Bookings: ");
            booking.GetUserBookings().ForEach(b =>
            {
                System.Console.WriteLine(b.Name, b.Category, b.AvailableTime);
            });



            System.Console.WriteLine("Would you like to cancel this booking?");
            while (true)
            {
                System.Console.Write("Enter movies's name (or stop): ");
                string input = System.Console.ReadLine();

                if (input == "stop")
                {
                    break;
                }

                var bookings = booking.CancelBooking(input);
                if (bookings != null)
                {
                    System.Console.WriteLine($"Movie {bookings.Name} was succesfully cancel");
                }
                else
                {
                    System.Console.WriteLine("You don't have this bookïng!");
                }
            }
        }
Esempio n. 5
0
 public IActionResult Cancel(int filmId)
 {
     bookingManager.CancelBooking(filmId);
     return(RedirectToAction());
 }