/// <summary> /// Get Order Details /// </summary> /// <param name="p"></param> /// <returns></returns> public OrderSumaryModel GetOrderDetails(int id) { ecom_Orders order = orderRepository.GetByID(id); OrderSumaryModel retValue = new OrderSumaryModel() { Id = order.Id, NameOfRecipient = order.NameOfRecipient, OrderCode = order.OrderCode, PhoneOfRecipient = order.PhoneOfRecipient, AddressOfRecipient = order.AddressOfRecipient, FeeShip = order.FeeShip, OrderNote = order.OrderNote, OrderStatus = EnumHelper.GetDescriptionFromEnum((OrderStatus)order.OrderStatus), CreatedDate = order.CreatedDate.ToString(), OrderDetailsList = from orderDetails in order.ecom_OrderDetails select new OrderDetailsSumaryModel() { ProductName = orderDetails.ecom_Products.Name, PriceOfUnit = orderDetails.PriceOfUnit, Quantity = orderDetails.Quantity, TotalDiscount = orderDetails.TotalDiscount, CoverImagePath = orderDetails.ecom_Products.CoverImage.ImagePath } }; return(retValue); }
// GET: Admin/Order/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OrderSumaryModel order = orderService.GetOrderDetails((int)id); if (order == null) { return(HttpNotFound()); } return(View(order)); }