From a45fceb0d9a94992c1ea52ed044903e0ad4010e8 Mon Sep 17 00:00:00 2001 From: Bhrugen Patel Date: Sun, 26 Sep 2021 16:20:06 -0500 Subject: [PATCH] Section 11 - Order Details Get Action --- .../Admin/Controllers/OrderController.cs | 13 ++ .../Areas/Admin/Views/Order/Details.cshtml | 162 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 BulkyBookWeb/Areas/Admin/Views/Order/Details.cshtml diff --git a/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs b/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs index e1a9421..7cb475c 100644 --- a/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs +++ b/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs @@ -1,5 +1,6 @@ using BulkyBook.DataAccess.Repository.IRepository; using BulkyBook.Models; +using BulkyBook.Models.ViewModels; using BulkyBook.Utility; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,6 +15,8 @@ namespace BulkyBookWeb.Areas.Admin.Controllers public class OrderController : Controller { private readonly IUnitOfWork _unitOfWork; + [BindProperty] + public OrderVM OrderVM { get; set; } public OrderController(IUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; @@ -24,6 +27,16 @@ public IActionResult Index() return View(); } + public IActionResult Details(int orderId) + { + OrderVM = new OrderVM() + { + OrderHeader = _unitOfWork.OrderHeader.GetFirstOrDefault(u => u.Id == orderId, includeProperties: "ApplicationUser"), + OrderDetail = _unitOfWork.OrderDetail.GetAll(u => u.OrderId == orderId, includeProperties: "Product"), + }; + return View(OrderVM); + } + #region API CALLS [HttpGet] public IActionResult GetAll(string status) diff --git a/BulkyBookWeb/Areas/Admin/Views/Order/Details.cshtml b/BulkyBookWeb/Areas/Admin/Views/Order/Details.cshtml new file mode 100644 index 0000000..5dee951 --- /dev/null +++ b/BulkyBookWeb/Areas/Admin/Views/Order/Details.cshtml @@ -0,0 +1,162 @@ +
+
+
+
+
+
+   Order Summary +
+ +
+
+
+
+
+
+

+ PickUp Details: +

+
+
+
Name
+
+ +
+
+
+
Phone
+
+ +
+
+
+
Address
+
+ +
+
+
+
City
+
+ +
+
+
+
State
+
+ +
+
+
+
Zip Code
+
+ +
+
+
+
Email
+
+ +
+
+
+
Order Date
+
+ +
+
+
+
Carrier
+
+ +
+
+
+
Tracking
+
+ +
+
+
+
Shipping Date
+
+ +
+
+
+
Transaction ID
+
+ +
+
+
+
Payment Due Date
+
+ +
+
Payment Date
+
+ +
+
+
+
Payment Status
+
+ +
+
+ + + +
+
+

+ Order Summary +

+ + +
    +
  • +
    +
    + +
    Product.Title
    + Price : Price
    + Quantity : Count +
    +
    +

    count * price

    +
    +
    +
  • + +
  • +
    +
    +
    TOTAL
    +
    +
    +
    $$$
    +
    +
    +
  • +
+ + + + + +
+
+
+
+
+
+
+ +