private void frmTheatre_Load(object sender, EventArgs e) { ticketPrice = Times.TicketPrice; lblInformation.Text = "Team4H Cinema - Nhà văn hóa sinh viên | " + Times.CinemaName + " | " + Times.MovieName; lblTime.Text = Times.Time.ToShortDateString() + " | " + Times.Time.ToShortTimeString() + " - " + Times.Time.AddMinutes(Movie.Time).ToShortTimeString(); if (Movie.Poster != null) { picFilm.Image = MovieDAO.byteArrayToImage(Movie.Poster); } rdoAdult.Checked = true; chkCustomer.Enabled = false; grpLoaiVe.Enabled = false; LoadDataCinema(Times.CinemaName); ShowOrHideLablePoint(); listSeat = TicketDAO.GetListTicketsByShowTimes(Times.ID); LoadSeats(listSeat); }
private void txtMovieID_TextChanged(object sender, EventArgs e) //Use to binding the CheckedListBox Genre of Movie and picture of Movie { picFilm.Image = null; for (int i = 0; i < clbMovieGenre.Items.Count; i++) { clbMovieGenre.SetItemChecked(i, false); //Uncheck all CheckBox first } List <Genre> listGenreOfMovie = MovieByGenreDAO.GetListGenreByMovieID(txtMovieID.Text); for (int i = 0; i < clbMovieGenre.Items.Count; i++) { Genre genre = (Genre)clbMovieGenre.Items[i]; foreach (Genre item in listGenreOfMovie) { if (genre.ID == item.ID) { clbMovieGenre.SetItemChecked(i, true); break; } } } Movie movie = MovieDAO.GetMovieByID(txtMovieID.Text); if (movie == null) { return; } if (movie.Poster != null) { picFilm.Image = MovieDAO.byteArrayToImage(movie.Poster); } }