コード例 #1
0
ファイル: frmPhim.cs プロジェクト: Hiissu/Phimwf
 private void btXoaPhim_Click(object sender, EventArgs e)
 {
     if (tbIdPhim.Text != null)
     {
         obj.XoaPhim(tbIdPhim.Text);
         grvPhim.DataSource = obj.HienThiTatCaPhim();
         XoaDuLieuDaNhap();
     }
     else
     {
         MessageBox.Show("Hãy chọn phim cần xóa.");
     }
 }
コード例 #2
0
        protected void btnXoaPhim_Click(object sender, EventArgs e)
        {
            PhimBLL phimBLL = new PhimBLL();
            bool    kq      = phimBLL.XoaPhim(Int32.Parse(txtMaPhim.Text), txtTenPhimGoc.Text);

            if (kq)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Delete Successed!" + "');", true);
                XoaThongTin();
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Delete Failed!" + "');", true);
                XoaThongTin();
            }
        }
コード例 #3
0
        void XoaPhim()
        {
            string maphim = dtgvPhim.SelectedRows[0].Cells[0].Value.ToString();

            if (MessageBox.Show("Bạn có chắc xóa phim có mã " + maphim + " không?", "Xóa phim", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (phim.XoaPhim(maphim))
                {
                    MessageBox.Show("Xóa phim thành công!");
                    LoadDtgvPhim();
                }
                else
                {
                    MessageBox.Show("Xóa phim không thành công!");
                }
            }
        }
コード例 #4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc muốn xóa?", "Confirm", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                try
                {
                    int    maPhim = int.Parse(dgvPhim.Rows[RowEnter].Cells[0].Value.ToString());
                    string rowVer = dgvPhim.Rows[RowEnter].Cells[5].Value.ToString();

                    if (phimBLL.XoaPhim(maPhim, rowVer))
                    {
                        MessageBox.Show("Xóa thành công!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                QuanLyPhim_Load(sender, e);
            }
        }