public NowPlayingDetailsPageViewModel(NowPlayingMovie movie)
        {
            Title = "Incredibles 2";

            //Cast = npm.SelectedMovie.Cast;

            MovieName       = movie.MovieName;
            ImageMovieCover = movie.Logo;
        }
Exemplo n.º 2
0
 public BookTicketPage(NowPlayingMovie movie)
 {
     _movie = movie;
     InitializeComponent();
     ImgMovieCover.Source = movie.CoverImage;
     LblMovieName.Text    = movie.MovieName;
     LblPlayingDate.Text  = movie.PlayingDate.ToShortDateString();
     LblTime1.Text        = movie.ShowTime1.ToShortTimeString();
     LblTime2.Text        = movie.ShowTime2.ToShortTimeString();
     LblTime3.Text        = movie.ShowTime3.ToShortTimeString();
     SpanAmount.Text      = movie.TicketPrice;
     SpanTotalPrice.Text  = movie.TicketPrice;
     SpanQty.Text         = "1";
 }
Exemplo n.º 3
0
        public BookTicketPage(NowPlayingMovie movie)
        {
            InitializeComponent();
            MovieImage.Source    = movie.CoverImage;
            Time1Label.Text      = movie.ShowTime1.ToShortTimeString();
            Time2Label.Text      = movie.ShowTime2.ToShortTimeString();
            Time3Label.Text      = movie.ShowTime3.ToShortTimeString();
            UnitPrice.Text       = movie.TicketPrice;
            MovieNameLabel.Text  = movie.MovieName;
            Picker.SelectedIndex = 0;
            Quantity.Text        = Picker.SelectedItem.ToString();

            ButtonBook.Clicked += async(sender, args) =>
            {
                var ticket = new BookTicket();
                ticket.MovieName    = MovieNameLabel.Text;
                ticket.Email        = EmailEntry.Text;
                ticket.CustomerName = NameEntry.Text;
                ticket.Phone        = PhoneEntry.Text;
                ticket.Qty          = Quantity.Text;
                ticket.BookingDate  = _selectedTime;
                ticket.TotalPayment = TotalPrice.Text;
                var api    = new ApiServices();
                var result = await api.PostOrder(ticket);

                if (result)
                {
                    await DisplayAlert("Message", "Your ticket was reserved...", "OK");
                }
                else
                {
                    await DisplayAlert("Error", "Something went wrong....", "OK");
                }

                await Navigation.PopAsync(true);
            };

            Picker.SelectedIndexChanged += (sender, args) =>
            {
                var quantity  = int.Parse(Picker.SelectedItem.ToString());
                var unitPrice = int.Parse(UnitPrice.Text);
                var total     = quantity * unitPrice;
                Quantity.Text   = quantity.ToString();
                TotalPrice.Text = total.ToString();
            };
        }
Exemplo n.º 4
0
 public MovieDetailPage(NowPlayingMovie nowPlayingMovie)
 {
     InitializeComponent();
     _nowPlayingMoview         = nowPlayingMovie;
     LabelMovie.Text           = _nowPlayingMoview.MovieName;
     LabelDuration.Text        = _nowPlayingMoview.Duration;
     LabelDate.Text            = _nowPlayingMoview.PlayingDate.ToLongDateString();
     LabelLanguage.Text        = _nowPlayingMoview.Language;
     LabelPg.Text              = _nowPlayingMoview.RatedLevel;
     LabelDescription.Text     = _nowPlayingMoview.Description;
     LabelGenre.Text           = _nowPlayingMoview.Genre;
     LabelStar.Text            = _nowPlayingMoview.Cast;
     ImageCover.Source         = _nowPlayingMoview.CoverImage;
     BookTicketButton.Clicked += async(sender, args) =>
     {
         await Navigation.PushAsync(new BookTicketPage(_nowPlayingMoview));
     };
 }
Exemplo n.º 5
0
 public NowPlayingDetailPage(NowPlayingMovie nowPlayingMovie)
 {
     InitializeComponent();
     LblMovieName.Text    = nowPlayingMovie.MovieName;
     ImgMovieCover.Source = nowPlayingMovie.CoverImage;
     LblDuration.Text     = nowPlayingMovie.Duration;
     LblLanguage.Text     = nowPlayingMovie.Language;
     LblMovieType.Text    = nowPlayingMovie.Genre;
     LblPlayingDate.Text  = nowPlayingMovie.PlayingDate.ToShortDateString();
     LblCast.Text         = nowPlayingMovie.Cast;
     LblDescription.Text  = nowPlayingMovie.Description;
     LblRatedLevel.Text   = nowPlayingMovie.RatedLevel;
     _trailorLink         = nowPlayingMovie.MovieTrailor;
     _time1       = nowPlayingMovie.ShowTime1.ToShortTimeString();
     _time2       = nowPlayingMovie.ShowTime2.ToShortTimeString();
     _time3       = nowPlayingMovie.ShowTime3.ToShortTimeString();
     _ticketPrice = nowPlayingMovie.TicketPrice;
 }
 public NowPlayingDetailPage(NowPlayingMovie movie)
 {
     _movie = movie;
     InitializeComponent();
     BindingContext = _movie;
 }
Exemplo n.º 7
0
 public MovieDetailPage()
 {
     InitializeComponent();
     _nowPlayingMoview = new NowPlayingMovie();
 }
Exemplo n.º 8
0
 public NowPlayingDetailsPage(NowPlayingMovie movie)
 {
     InitializeComponent();
     BindingContext = new NowPlayingDetailsPageViewModel(movie);
 }