void DeleteFormat(string id) { if (FormatMovieDAO.DeleteFormatMovie(id)) { MessageBox.Show("Xóa định dạng thành công"); } else { MessageBox.Show("Xóa định dạng thất bại"); } }
void UpdateFormat(string id, string idMovie, string idScreen) { if (FormatMovieDAO.UpdateFormatMovie(id, idMovie, idScreen)) { MessageBox.Show("Sửa định dạng thành công"); } else { MessageBox.Show("Sửa định dạng thất bại"); } }
void InsertFormat(string id, string idMovie, string idScreen) { if (FormatMovieDAO.InsertFormatMovie(id, idMovie, idScreen)) { MessageBox.Show("Thêm định dạng thành công"); } else { MessageBox.Show("Thêm định dạng thất bại"); } }
private void cboFilmName_SelectedIndexChanged(object sender, EventArgs e) { if (cboFilmName.SelectedIndex != -1) { cboFormatFilm.DataSource = null; lvLichChieu.Items.Clear(); Movie movie = cboFilmName.SelectedItem as Movie; cboFormatFilm.DataSource = FormatMovieDAO.GetListFormatMovieByMovie(movie.ID); cboFormatFilm.DisplayMember = "ScreenTypeName"; } }
private void txtShowtimeID_TextChanged(object sender, EventArgs e) { #region Change selected index of ComboBox FormatMovie string movieName = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Tên phim"].Value; string screenTypeName = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Màn hình"].Value; FormatMovie formatMovieSelecting = FormatMovieDAO.GetFormatMovieByName(movieName, screenTypeName); if (formatMovieSelecting == null) { return; } int indexFormatMovie = -1; for (int i = 0; i < cboFormatID_Showtime.Items.Count; i++) { FormatMovie item = cboFormatID_Showtime.Items[i] as FormatMovie; if (item.ID == formatMovieSelecting.ID) { indexFormatMovie = i; break; } } cboFormatID_Showtime.SelectedIndex = indexFormatMovie; #endregion #region Change selected index of ComboBox Cinema string cinemaID = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Mã phòng"].Value; Cinema cinemaSelecting = CinemaDAO.GetCinemaByID(cinemaID); //This is the Cinema that we're currently selecting in dtgv if (cinemaSelecting == null) { return; } int indexCinema = -1; int iCinema = 0; foreach (Cinema item in cboCinemaID_Showtime.Items) { if (item.ID == cinemaSelecting.ID) { indexCinema = iCinema; break; } iCinema++; } cboCinemaID_Showtime.SelectedIndex = indexCinema; #endregion toolTipCinema.SetToolTip(cboCinemaID_Showtime, "Danh sách phòng chiếu hỗ trợ loại màn hình trên"); }
void LoadFormatMovieIntoComboBox() { cboFormatID_Showtime.DataSource = FormatMovieDAO.GetFormatMovie(); cboFormatID_Showtime.DisplayMember = "ID"; }
void LoadFormatMovieList() { formatList.DataSource = FormatMovieDAO.GetListFormatMovie(); }
private void btnFormat_Click(object sender, EventArgs e) { string movieName = txtSearchFormat.Text; formatList.DataSource = FormatMovieDAO.SearchFormatByMovieName(movieName); }