Exemplo n.º 1
0
        public ActionResult DeleteItem(ItemViewModel model, string id)
        {
            _item.DeleteItem(id);

            RedirectToAction("Index");
            //Content("Sucessfull");
            return(View());
        }
Exemplo n.º 2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc chắn muốn xóa!", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
            {
                return;
            }
            else
            {
                _ItemBusiness = new ItemBusiness();
                var index = dgvListItem.CurrentCell.RowIndex;

                if (_ItemBusiness.DeleteItem(_lstItemDTO[index].Id))
                {
                    MessageBox.Show("Xóa Thành Công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LoadData();
                }
                else
                {
                    MessageBox.Show("Xóa không thành công!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
        }
Exemplo n.º 3
0
 public bool Delete(string id)
 {
     return(_ItemBusiness.DeleteItem(id));
 }