Example #1
0
        public async Task <IActionResult> CompleteOrder(int userId, int cartsId, [FromBody] Orders order)
        {
            _serviceOrder.CompleteOrder(userId, cartsId, order);
            _serviceCarts.OffCart(cartsId);

            return(Ok());
        }
Example #2
0
        public ActionResult Close(int id)
        {
            var result = _ordersService.CompleteOrder(id);

            if (result == ChangeOrderStatusResult.InvalidStatus)
            {
                return(View("InvalidStatus"));
            }

            if (result == ChangeOrderStatusResult.NotFound)
            {
                return(HttpNotFound());
            }

            return(RedirectToAction("Index"));
        }