public SeatListPageViewModel(SeatListPage view, TicketRepository repository)
        {
            this.view = view;
            this.repository = repository;

            RetrieveData();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TicketService"/> class.
        /// </summary>
        /// <param name="unitOfWork">The unit of work.</param>
        public TicketService(UnitOfWork unitOfWork)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException(UnitOfWorkConst);
            }

            this.unitOfWork = unitOfWork;
            this.ticketRepository = new TicketRepository(this.unitOfWork);
        }
        public CheckoutPageViewModel(CheckoutPage view, TicketRepository repository, Showtime showtime,
            List<AuditoriumSeat> seats)
        {
            this.repository = repository;
            this.showtime = showtime;
            this.seats = seats;
            this.view = view;

            Total = showtime.Price*seats.Count;

            ArrowAnimatedBrush = new SolidColorBrush();
        }
        public AuditoriumMapPageViewModel(AuditoriumMapPage view, TicketRepository repository, Showtime showtime)
        {
            this.view = view;
            this.repository = repository;
            this.showtime = showtime;
            seats = new List<AuditoriumSeat>();

            var occupiedSeats = repository.GetOccupiedSeats(showtime.Id).ToList();

            Auditorium = new AuditoriumView(showtime.Auditorium, occupiedSeats);
            Auditorium.PropertyChanged += SelectionChanged;

            Total = "0";
        }
        public AuditoriumMapPage(Showtime showtime)
        {
            InitializeComponent();

            var connectionString = ConnectionStringBuilder.Build(
                Settings.Default.server,
                Settings.Default.database,
                Settings.Default.user,
                Settings.Default.password);

            var repository = new TicketRepository(connectionString);

            viewModel = new AuditoriumMapPageViewModel(this, repository, showtime);
            DataContext = viewModel;
        }
        public CheckoutPage(Showtime showtime, List<AuditoriumSeat> seats)
        {
            InitializeComponent();

            var connectionString = ConnectionStringBuilder.Build(
                Settings.Default.server,
                Settings.Default.database,
                Settings.Default.user,
                Settings.Default.password);

            var repository = new TicketRepository(connectionString);

            viewModel = new CheckoutPageViewModel(this, repository, showtime, seats);
            DataContext = viewModel;

            SetUpAnimations();
        }