public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         ProductBus.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #2
0
        private void TaskControl1_DeleteEvent(object sender, EventArgs e)
        {
            var hs = new HangHoa()
            {
                ID = int.Parse(txtProductId.Text)
            };

            if (productBus.Delete(hs))
            {
                MessageBox.Show("Xóa hàng hóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadAll();
                return;
            }
            MessageBox.Show("Xóa hàng hóa không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }