Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CustomerOrder customerOrder = new CustomerOrder();

            customerOrderRepository.DeleteOrder(id);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public HttpResponseMessage DeleteOrder(int id)
        {
            HttpResponseMessage message = null;

            try
            {
                CustomerOrderRepository customerRepo = new CustomerOrderRepository();
                customerRepo.DeleteOrder(id);

                message      = Request.CreateResponse(HttpStatusCode.Accepted, "Silme Başarılı");
                customerRepo = null;
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message.ToString());
            }

            return(message);
        }