35 lines
1017 B
Plaintext
35 lines
1017 B
Plaintext
@page "/ProductDetails/{Id:int}"
|
|
@inherits ProductDetailsBase
|
|
|
|
@if(Product == null && ErrorMessage == null)
|
|
{
|
|
<DisplaySpinner/>
|
|
}
|
|
else if(ErrorMessage != null)
|
|
{
|
|
<DisplayError ErrorMessage="@ErrorMessage"></DisplayError>
|
|
}
|
|
else
|
|
{
|
|
<h3 class="mb-5">Product Details</h3>
|
|
<div class="row">
|
|
<div class="col-md-6 mb-4">
|
|
<img class="img-fluid" src="@Product.ImageURL" >
|
|
</div>
|
|
<div class="col-mb-6">
|
|
<h3>@Product.Name</h3>
|
|
<p class="mb-4"> @Product.Description</p>
|
|
<p class="mb-4">
|
|
<b>@Product.Price.ToString("C") (@Product.Quantity in stock)</b>
|
|
</p>
|
|
<div>
|
|
<button class="btn btn-success"
|
|
@onclick = "() => AddToCart_Click(new CartItemToAddDto {
|
|
CartId = HardCoded.CartId, ProductId = Product.Id, Quantity = 1,
|
|
})"
|
|
>Add To Cart</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |