Пример #1
0
 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");
     }
 }
Пример #2
0
 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");
     }
 }
Пример #3
0
 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";
     }
 }
Пример #5
0
        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");
        }
Пример #6
0
 void LoadFormatMovieIntoComboBox()
 {
     cboFormatID_Showtime.DataSource    = FormatMovieDAO.GetFormatMovie();
     cboFormatID_Showtime.DisplayMember = "ID";
 }
Пример #7
0
 void LoadFormatMovieList()
 {
     formatList.DataSource = FormatMovieDAO.GetListFormatMovie();
 }
Пример #8
0
        private void btnFormat_Click(object sender, EventArgs e)
        {
            string movieName = txtSearchFormat.Text;

            formatList.DataSource = FormatMovieDAO.SearchFormatByMovieName(movieName);
        }