public ActionResult DeleteItem(ItemViewModel model, string id) { _item.DeleteItem(id); RedirectToAction("Index"); //Content("Sucessfull"); return(View()); }
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; } } }
public bool Delete(string id) { return(_ItemBusiness.DeleteItem(id)); }