Exemplo n.º 1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            _currentRowIndex = gridView1.FocusedRowHandle;
            if (_currentRowIndex < 0)
            {
                return;
            }
            var MaDVT   = gridView1.GetRowCellValue(_currentRowIndex, gridView1.Columns["MaDVT"]).ToString();
            var dresult = XtraMessageBox.Show("bạn có muốn xoá ?", "thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dresult == DialogResult.No)
            {
                return;
            }
            if (_DVT.Delete(MaDVT))
            {
                MessageBox.Show(this, "Xoá Thành Công", "thông báo");
                _currentRowIndex = 0;
                hienThi();
            }
            else
            {
                MessageBox.Show(this, "Xoá không Thành Công", "Lỗi");
            }
        }
Exemplo n.º 2
0
        protected void gvDS_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int  id = int.Parse(gvDS.DataKeys[e.RowIndex].Value.ToString());
            bool kq = dv.Delete(id);

            if (kq == true)
            {
                Load();
            }
            else
            {
                Response.Write("<script>alert('Không xoá được !');</script>");
            }
        }
Exemplo n.º 3
0
 public int Delete(int IDDonViTinh)
 {
     return(dao.Delete(IDDonViTinh));
 }
Exemplo n.º 4
0
 public Int64 Delete(DonViTinhDTO _nv)
 {
     return(nvDAO.Delete(_nv.id));
 }