Beispiel #1
0
        public void deleteOrderProduct(int id)
        {
            OrderProduct OrderProduct = OrderProductRepository.GetById(id);

            OrderProductRepository.Delete(OrderProduct);
            SaveChange();
        }
Beispiel #2
0
        public bool Delete(int?Id)
        {
            var getId = Get(Id);

            if (getId != null)
            {
                _orderproductRepository.Delete(Id);
                status = true;
            }
            return(status);
        }
Beispiel #3
0
        public ActionResult DeleteOrder(int orderId)
        {
            var order         = _orderRepository.GetById(orderId);
            var orderProducts = _orderProductRepository.GetMany(o => o.Order.Id == orderId);

            foreach (var itemOP in orderProducts)
            {
                _orderProductRepository.Delete(itemOP);
            }
            _orderRepository.Delete(order);
            if (order != null)
            {
                TempData["Message"] = string.Format("{0} was deleted", order.Id);
            }
            _unitOfWork.Commit();
            return(RedirectToAction("Index"));
        }