Example #1
0
 private void cboFormatFilm_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboFormatFilm.SelectedIndex != -1)
     {
         lvLichDi.Items.Clear();
         FormatTaudto format = cboFormatFilm.SelectedItem as FormatTaudto;
         LoadListShowTimeByFilm(format.ID);
     }
 }
Example #2
0
        private void cboFormatID_Showtime_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboFormatID_Showtime.SelectedIndex != -1)
            {
                FormatTaudto formatthienboatSelecting = (FormatTaudto)cboFormatID_Showtime.SelectedItem;
                txtthienboatName_Showtime.Text  = formatthienboatSelecting.thienboatName;
                txtScreenTypeName_Showtime.Text = formatthienboatSelecting.ScreenTypeName;

                cboCinemaID_Showtime.DataSource = null;
                ScreenType screenType = ScreenTypeDAO.GetScreenTypeByName(formatthienboatSelecting.ScreenTypeName);
                cboCinemaID_Showtime.DataSource    = TauDAO.GetCinemaByScreenTypeID(screenType.ID);
                cboCinemaID_Showtime.DisplayMember = "Name";
            }
        }
Example #3
0
        public static List <FormatTaudto> GetFormatthienboat()
        {
            List <FormatTaudto> formatthienboatList = new List <FormatTaudto>();
            DataTable           data = DataProvider.ExecuteQuery("SELECT DD.id, P.TenTau, MH.TenMH " +
                                                                 "FROM dbo.DinhDangTau DD, dbo.Tau P, dbo.LoaiVe MH " +
                                                                 "WHERE DD.idTau = P.id AND DD.idLoaiTau = MH.id");

            foreach (DataRow item in data.Rows)
            {
                FormatTaudto formatthienboat = new FormatTaudto(item);
                formatthienboatList.Add(formatthienboat);
            }
            return(formatthienboatList);
        }
Example #4
0
        public static List <FormatTaudto> GetListFormatthienboatBythienboat(string thienboatID)
        {
            List <FormatTaudto> listFormat = new List <FormatTaudto>();
            string query = "select d.id, p.TenTau, m.TenMH " +
                           "from Tau p, DinhDangTau d, LoaiVe m " +
                           "where p.id = d.idTau and d.idLoaiTau = m.id "
                           + "and p.id = '" + thienboatID + "'";
            DataTable data = DataProvider.ExecuteQuery(query);

            foreach (DataRow row in data.Rows)
            {
                FormatTaudto format = new FormatTaudto(row);
                listFormat.Add(format);
            }
            return(listFormat);
        }
Example #5
0
        private void txtShowtimeID_TextChanged(object sender, EventArgs e)
        {
            #region Change selected index of ComboBox Formatthienboat
            string       thienboatName            = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Tên Tau"].Value;
            string       screenTypeName           = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Màn hình"].Value;
            FormatTaudto formatthienboatSelecting = FormatTauDAO.GetFormatthienboatByName(thienboatName, screenTypeName);
            if (formatthienboatSelecting == null)
            {
                return;
            }
            int indexFormatthienboat = -1;
            for (int i = 0; i < cboFormatID_Showtime.Items.Count; i++)
            {
                FormatTaudto item = cboFormatID_Showtime.Items[i] as FormatTaudto;
                if (item.ID == formatthienboatSelecting.ID)
                {
                    indexFormatthienboat = i;
                    break;
                }
            }
            cboFormatID_Showtime.SelectedIndex = indexFormatthienboat;
            #endregion
            #region Change selected index of ComboBox Cinema
            string cinemaID        = (string)dtgvShowtime.SelectedCells[0].OwningRow.Cells["Mã phòng"].Value;
            Taudto cinemaSelecting = TauDAO.GetCinemaByID(cinemaID);
            //This is the Cinema that we're currently selecting in dtgv

            if (cinemaSelecting == null)
            {
                return;
            }

            int indexCinema = -1;
            int iCinema     = 0;
            foreach (Taudto 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 hỗ trợ loại phòng trên");
        }