private void frmTau_Load(object sender, EventArgs e) { ticketPrice = Times.TicketPrice; lblInformation.Text = "Thien Boat | " + Times.CinemaName + " | " + Times.thienboatName; lblTime.Text = Times.Time.ToShortDateString() + " | " + Times.Time.ToShortTimeString() + " - " + Times.Time.AddMinutes(thienboat.Time).ToShortTimeString(); if (thienboat.Poster != null) { picFilm.Image = TaudiDAO.byteArrayToImage(thienboat.Poster); } rdoAdult.Checked = true; chkCustomer.Enabled = false; grpLoaiVe.Enabled = false; LoadDataCinema(Times.CinemaName); ShowOrHideLablePoint(); listSeat = TicketDAO.GetListTicketsByShowTimes(Times.ID); LoadSeats(listSeat); }
private void txtFormatID_TextChanged(object sender, EventArgs e) { string thienboatID = (string)dtgvFormat.SelectedCells[0].OwningRow.Cells["Mã Tau"].Value; Taudidto thienboatSelecting = TaudiDAO.GetthienboatByID(thienboatID); //This is the thienboat that we're currently selecting in dtgv if (thienboatSelecting == null) { return; } //cboFormat_thienboatID.SelectedItem = thienboatSelecting; int indexthienboat = -1; int ithienboat = 0; foreach (Taudidto item in cboFormat_thienboatID.Items) { if (item.Name == thienboatSelecting.Name) { indexthienboat = ithienboat; break; } ithienboat++; } cboFormat_thienboatID.SelectedIndex = indexthienboat; string screenName = (string)dtgvFormat.SelectedCells[0].OwningRow.Cells["Tên MH"].Value; ScreenType screenTypeSelecting = ScreenTypeDAO.GetScreenTypeByName(screenName); //This is the ScreenType that we're currently selecting in dtgv if (screenTypeSelecting == null) { return; } //cboFormat_ScreenID.SelectedItem = screenTypeSelecting; int indexScreen = -1; int iScreen = 0; foreach (ScreenType item in cboFormat_ScreenID.Items) { if (item.Name == screenTypeSelecting.Name) { indexScreen = iScreen; break; } iScreen++; } cboFormat_ScreenID.SelectedIndex = indexScreen; }
void Insertthienboat(string id, string name, string desc, float length, DateTime startDate, DateTime endDate, string productor, string director, int year, byte[] image) { if (TaudiDAO.Insertthienboat(id, name, desc, length, startDate, endDate, productor, director, year, image)) { MessageBox.Show("Thêm Tau thành công"); } else { MessageBox.Show("Thêm Tau thất bại"); } }
void Deletethienboat(string id) { if (TaudiDAO.Deletethienboat(id)) { MessageBox.Show("Xóa Tau thành công"); } else { MessageBox.Show("Xóa Tau thất bại"); } }
private void txtthienboatID_TextChanged(object sender, EventArgs e) //Use to binding the CheckedListBox Genre of thienboat and picture of thienboat { picFilm.Image = null; for (int i = 0; i < clbthienboatGenre.Items.Count; i++) { clbthienboatGenre.SetItemChecked(i, false); //Uncheck all CheckBox first } List <Genre> listGenreOfthienboat = TauByGenreDAO.GetListGenreBythienboatID(txtthienboatID.Text); for (int i = 0; i < clbthienboatGenre.Items.Count; i++) { Genre genre = (Genre)clbthienboatGenre.Items[i]; foreach (Genre item in listGenreOfthienboat) { if (genre.ID == item.ID) { clbthienboatGenre.SetItemChecked(i, true); break; } } } Taudidto thienboat = TaudiDAO.GetthienboatByID(txtthienboatID.Text); if (thienboat == null) { return; } if (thienboat.Poster != null) { picFilm.Image = TaudiDAO.byteArrayToImage(thienboat.Poster); } }
void LoadthienboatList() { thienboatList.DataSource = TaudiDAO.Getthienboat(); }
private void btnUpdatethienboat_Click(object sender, EventArgs e) { string thienboatID = txtthienboatID.Text; string thienboatName = txtthienboatName.Text; string thienboatDesc = txtthienboatDesc.Text; float thienboatLength = float.Parse(txtthienboatLength.Text); DateTime startDate = dtmthienboatStart.Value; DateTime endDate = dtmthienboatEnd.Value; string productor = txtthienboatProductor.Text; string director = txtthienboatDirector.Text; int year = int.Parse(txtthienboatYear.Text); if (picFilm.Image == null) { MessageBox.Show("Mời bạn thêm hình ảnh cho Tau trước"); return; } Updatethienboat(thienboatID, thienboatName, thienboatDesc, thienboatLength, startDate, endDate, productor, director, year, TaudiDAO.imageToByteArray(picFilm.Image)); Updatethienboat_Genre(thienboatID, clbthienboatGenre); LoadthienboatList(); }
void LoadthienboatIDIntoCombobox(ComboBox comboBox) { comboBox.DataSource = TaudiDAO.GetListthienboat(); comboBox.DisplayMember = "ID"; comboBox.ValueMember = "ID"; }
private void Loadthienboat(DateTime date) { cboFilmName.DataSource = TaudiDAO.GetListthienboatByDate(date); cboFilmName.DisplayMember = "Name"; }