Online Restaurant Website Part 42 Orders History
Hi, Dear's here we learn how to implement "Pizza Restaurant Drink" Website in Visual Studio using C# ASP.NET MVC. Ilyasoft software company provide full project step by step training on our YouTube Channel ilyasoft software company so now subscribe, share and like for more project base tutorials
So in this video we don't need to create view or action just go dashboard view and add
below code in history tab.
> Code
<div id="history" class="tab-pane fade">
@foreach (var order in Model.AllOrders)
{
<div class="item-entry">
<span class="order-id">Order ID: PIR-@order.OrderID</span>
<div class="item-content">
<div class="item-body">
<div class="row">
<div class="col-md-8 col-sm-8 text-center">
<div class="row">
@foreach (var item in order.OrderDetails)
{
<div class="product-layout product-grid col-lg-4 col-md-4 col-sm-6 col-12">
<div class="product-thumb">
<div class="image">
<a class="link" href="@Url.Content("~/Home/ProductDetail?itemid="+item.StockItemID)">
<img src="@Url.Content(item.ItemPhotoPath)" alt="Food image" title="Food image" class="img-fluid" />
</a>
</div>
<div class="caption">
<h4>@item.StockItemTitle (@item.ItemSize)</h4>
<div class="price">Quantity : @item.Qty</div>
<div class="price">Price : @item.UnitPrice</div>
<p class="des">Item Cost : @(item.Qty * item.UnitPrice) </p>
</div>
</div>
</div>
}
</div>
</div>
<div class="col-md-4 col-sm-3 text-right">
@if (order.OrderStatusID == 1)
{
<p class="confirmed"><i class="icofont icofont-check"></i>@order.OrderStatus</p>
<button type="button" class="btn btn-theme btn-md">
<i class="icofont icofont-close-line"></i>Cancel
</button>
}
else if (order.OrderStatusID <= 4 && order.OrderStatusID >= 2)
{
<p class="confirmed"><i class="icofont icofont-check"></i>@order.OrderStatus</p>
}
else if (order.OrderStatusID >= 5)
{
<p class="failed"><i class="icofont icofont-close"></i>@order.OrderStatus</p>
}
</div>
</div>
</div>
<div class="item-footer order-id" style="display: flex; justify-content: space-between;">
<div style="align-content:start;"><strong>Order Date:</strong> @order.Order_DateTime.ToString("dd MMMM yyyy hh:mm:tt")</div>
<div style="align-content:end;"><strong>Order Total Cost:</strong> @order.TotalCost</div>
</div>
</div>
</div>
}
<div class="text-center load-more">
<a class="btn btn-theme btn-md btn-wide" href="#">LOAD MORE</a>
</div>
</div>
once all the above step is done, run the application.
Comments
Post a Comment