public async Task <IActionResult> Delete(OrderDeleteRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var result = await _orderApiClient.DeleteOrder(request.Id);

            if (result == 1)
            {
                TempData["result"] = "Xóa đơn hàng thành công";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Xóa đơn hàng không thành công ");
            return(View(request));
        }
Beispiel #2
0
        public async Task <IActionResult> DeleteOrder(int Id)
        {
            await _orderApiClient.DeleteOrder(Id);

            return(RedirectToAction("Index"));
        }