Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 public static DataTable Timtheomapc(string mapc)
 {
     return(LichChieuDAO.Timtheomapc(mapc));
 }
Exemplo n.º 3
0
 public static DataTable TimTheongaychieu(DateTime ngaychieu)
 {
     return(LichChieuDAO.Timtheongaychieu(ngaychieu));
 }
Exemplo n.º 4
0
 public static void Xoa(DateTime ngaychieu, string maphim, string macc, string mapc)
 {
     LichChieuDAO.Xoa(ngaychieu, maphim, macc, mapc);
 }
Exemplo n.º 5
0
 public static void Sua(LichChieuDTO lc)
 {
     LichChieuDAO.Sua(lc);
 }
Exemplo n.º 6
0
 public static void Them(LichChieuDTO lc)
 {
     LichChieuDAO.Them(lc);
 }
Exemplo n.º 7
0
 public static DataTable DatVe_Phim_NgayChieu(string maphim, string ngaychieu)
 {
     return(LichChieuDAO.DatVe_Phim_NgayChieu(maphim, ngaychieu));
 }
Exemplo n.º 8
0
 public static DataTable HienLichChieuPhim_NgayChieu_MaCC_MaPC(DateTime ngaychieu, string macc, string mapc)
 {
     return(LichChieuDAO.HienLichChieuPhim_NgayChieu_MaCC_MaPC(ngaychieu, macc, mapc));
 }
Exemplo n.º 9
0
 public static DataTable HienLichChieuPhim(DateTime ngaychieu, string macc)
 {
     return(LichChieuDAO.HienLichChieuPhim(ngaychieu, macc));
 }
Exemplo n.º 10
0
 public static DataTable LoadDSNgayChieu()
 {
     return(LichChieuDAO.LoadDSNgayChieu());
 }
Exemplo n.º 11
0
 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);
         }
     }
 }
Exemplo n.º 12
0
        public LichChieuDTO LoadLich(DateTime ngay)
        {
            LichChieuDAO lich = new LichChieuDAO();

            return(lich.loadLC(ngay));
        }
Exemplo n.º 13
0
        public List <LichChieuDTO> LoadLich()
        {
            LichChieuDAO lich = new LichChieuDAO();

            return(lich.loadLC());
        }