private void btnXoa_Click(object sender, EventArgs e) { if (btnXoa.Text == "Xóa") { if (MessageBox.Show("Bạn muốn xóa?", "Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { bool result = new LichChieuDAO().Delete(Convert.ToInt32(txbMa.Text)); if (result) { MessageBox.Show("Xóa thành công", "Thành công", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadData(dtpNgayChieu.Value.Date); } else { MessageBox.Show("Có lỗi xảy ra", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } else { LockControl(true); btnThem.Text = "Thêm"; btnSua.Text = "Sửa"; btnXoa.Text = "Xóa"; btnThem.Enabled = true; btnSua.Enabled = true; btnThoat.Enabled = true; } }
public static DataTable Timtheomapc(string mapc) { return(LichChieuDAO.Timtheomapc(mapc)); }
public static DataTable TimTheongaychieu(DateTime ngaychieu) { return(LichChieuDAO.Timtheongaychieu(ngaychieu)); }
public static void Xoa(DateTime ngaychieu, string maphim, string macc, string mapc) { LichChieuDAO.Xoa(ngaychieu, maphim, macc, mapc); }
public static void Sua(LichChieuDTO lc) { LichChieuDAO.Sua(lc); }
public static void Them(LichChieuDTO lc) { LichChieuDAO.Them(lc); }
public static DataTable DatVe_Phim_NgayChieu(string maphim, string ngaychieu) { return(LichChieuDAO.DatVe_Phim_NgayChieu(maphim, ngaychieu)); }
public static DataTable HienLichChieuPhim_NgayChieu_MaCC_MaPC(DateTime ngaychieu, string macc, string mapc) { return(LichChieuDAO.HienLichChieuPhim_NgayChieu_MaCC_MaPC(ngaychieu, macc, mapc)); }
public static DataTable HienLichChieuPhim(DateTime ngaychieu, string macc) { return(LichChieuDAO.HienLichChieuPhim(ngaychieu, macc)); }
public static DataTable LoadDSNgayChieu() { return(LichChieuDAO.LoadDSNgayChieu()); }
private void btnThem_Click(object sender, EventArgs e) { if (btnThem.Text == "Thêm") { ClearText(); btnThem.Text = "Lưu"; btnXoa.Text = "Hủy"; btnSua.Enabled = false; btnThoat.Enabled = false; LockControl(false); } else { LichChieu item = new LichChieu(); try { item.GiaVe = Convert.ToDecimal(txbGiaVe.Text); } catch { MessageBox.Show("Nhập sai giá vé !", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { item.ThoiGianBatDau = TimeSpan.Parse(txbTgBatDau.Text); } catch { MessageBox.Show("Nhập sai thời gian bắt đầu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { item.ThoiGianKetThuc = TimeSpan.Parse(txbTgKetThuc.Text); } catch { MessageBox.Show("Nhập sai thời gian kết thúc!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } item.NgayChieu = dtpNgayChieu.Value.Date; item.PhimID = Convert.ToInt32(cboPhim.SelectedValue); item.PhongChieuID = Convert.ToInt32(cboPhongChieu.SelectedValue); bool res = new LichChieuDAO().Insert(item); if (!res) { MessageBox.Show("Có lỗi xảy ra !", " Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { MessageBox.Show("Thêm thành công!", "Thành công", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadData(dtpNgayChieu.Value.Date); btnThem.Text = "Thêm"; btnXoa.Text = "Xóa"; btnSua.Enabled = true; btnThoat.Enabled = true; LockControl(true); } } }
public LichChieuDTO LoadLich(DateTime ngay) { LichChieuDAO lich = new LichChieuDAO(); return(lich.loadLC(ngay)); }
public List <LichChieuDTO> LoadLich() { LichChieuDAO lich = new LichChieuDAO(); return(lich.loadLC()); }