diff --git a/BulkyBook.Models/ViewModels/OrderVM.cs b/BulkyBook.Models/ViewModels/OrderVM.cs new file mode 100644 index 0000000..7d4536f --- /dev/null +++ b/BulkyBook.Models/ViewModels/OrderVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BulkyBook.Models.ViewModels +{ + public class OrderVM + { + public OrderHeader OrderHeader { get; set; } + public IEnumerable OrderDetail { get; set; } + } +} diff --git a/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs b/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs new file mode 100644 index 0000000..931a709 --- /dev/null +++ b/BulkyBookWeb/Areas/Admin/Controllers/OrderController.cs @@ -0,0 +1,31 @@ +using BulkyBook.DataAccess.Repository.IRepository; +using BulkyBook.Models; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace BulkyBookWeb.Areas.Admin.Controllers +{ + public class OrderController : Controller + { + private readonly IUnitOfWork _unitOfWork; + public OrderController(IUnitOfWork unitOfWork) + { + _unitOfWork = unitOfWork; + } + + public IActionResult Index() + { + return View(); + } + + #region API CALLS + [HttpGet] + public IActionResult GetAll() + { + IEnumerable orderHeaders; + orderHeaders = _unitOfWork.OrderHeader.GetAll(includeProperties: "ApplicationUser"); + return Json(new { data = orderHeaders }); + } + #endregion + } +} diff --git a/BulkyBookWeb/Areas/Admin/Views/Order/Index.cshtml b/BulkyBookWeb/Areas/Admin/Views/Order/Index.cshtml new file mode 100644 index 0000000..e1dd794 --- /dev/null +++ b/BulkyBookWeb/Areas/Admin/Views/Order/Index.cshtml @@ -0,0 +1,5 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ +} diff --git a/BulkyBookWeb/Areas/Customer/Controllers/CartController.cs b/BulkyBookWeb/Areas/Customer/Controllers/CartController.cs index 67ea32f..d69f2f5 100644 --- a/BulkyBookWeb/Areas/Customer/Controllers/CartController.cs +++ b/BulkyBookWeb/Areas/Customer/Controllers/CartController.cs @@ -174,10 +174,6 @@ public IActionResult SummaryPOST() { return RedirectToAction("OrderConfirmation", "Cart", new { id = ShoppingCartVM.OrderHeader.Id }); } - - //_unitOfWork.ShoppingCart.RemoveRange(ShoppingCartVM.ListCart); - //_unitOfWork.Save(); - //return RedirectToAction("Index","Home"); } public IActionResult OrderConfirmation(int id)