Exemple #1
0
 public void DeleteItem(Guid id)
 {
     try
     {
         var itemBL = new ItemBL();
         itemBL.DeleteItem(id);
     }
     catch (Exception)
     {
     }
 }
Exemple #2
0
        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));
        }
Exemple #3
0
        // 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);
        }