public void DeleteItem(Guid id) { try { var itemBL = new ItemBL(); itemBL.DeleteItem(id); } catch (Exception) { } }
public ActionResult DeleteItem(int id) { ItemBL itemBL = new ItemBL(); List <Item> itemList = itemBL.GetItems(); Item item = itemList.Where(u => u.ItemId == id).Single(); itemBL.DeleteItem(item); ShopVM shopVM = new ShopVM(); shopVM.shop = itemBL.GetItems(); return(RedirectToAction("Shop", "Home", shopVM)); }
// DELETE: api/Unit/5 public ServerResponse Delete(string id) { var res = new ServerResponse(); using (ItemBL itemBL = new ItemBL()) { try { res.Data = itemBL.DeleteItem(id); } catch (Exception ex) { res.Success = false; } } return(res); }