Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
s8_ivanov_r
VPL-pizza-shop-blazor
Commits
84e28c1f
Commit
84e28c1f
authored
Jan 24, 2019
by
Ryan Nowak
Browse files
Clean up other price formatting
parent
d2adaee5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
8 deletions
+15
-8
src/BlazingPizza.Client/Pages/MyOrders.cshtml
src/BlazingPizza.Client/Pages/MyOrders.cshtml
+1
-1
src/BlazingPizza.Client/Pages/OrderDetails.cshtml
src/BlazingPizza.Client/Pages/OrderDetails.cshtml
+2
-2
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
+4
-4
src/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml
src/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml
+1
-1
src/BlazingPizza.Shared/Pizza.cs
src/BlazingPizza.Shared/Pizza.cs
+5
-0
src/BlazingPizza.Shared/Topping.cs
src/BlazingPizza.Shared/Topping.cs
+2
-0
No files found.
src/BlazingPizza.Client/Pages/MyOrders.cshtml
View file @
84e28c1f
...
...
@@ -23,7 +23,7 @@
Items:
<strong>
@item.Order.Pizzas.Count()
</strong>
;
Total price:
<strong>
£@item.Order.GetTotalPrice()
.ToString("0.00")
</strong>
<strong>
£@item.Order.Get
Formatted
TotalPrice()
</strong>
</div>
<div
class=
"col"
>
Status:
<strong>
@item.StatusText
</strong>
...
...
src/BlazingPizza.Client/Pages/OrderDetails.cshtml
View file @
84e28c1f
...
...
@@ -33,7 +33,7 @@
<strong>
@(Pizza.GetSizeInInches(pizza.Size))"
@pizza.Special.Name
(£@pizza.GetTotalPrice()
.ToString("0.00")
)
(£@pizza.Get
Formatted
TotalPrice())
</strong>
</p>
...
...
@@ -48,7 +48,7 @@
<p>
<strong>
Total price:
£@orderWithStatus.Order.GetTotalPrice()
.ToString("0.00")
£@orderWithStatus.Order.Get
Formatted
TotalPrice()
</strong>
</p>
</div>
...
...
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
View file @
84e28c1f
...
...
@@ -18,7 +18,7 @@
</label>
}
</div>
<label>
£@(Pizza.Get
BasePrice().ToString("0.00"
))
</label>
<label>
£@(Pizza.Get
FormattedTotalPrice(
))
</label>
</div>
</div>
@if (AllToppings == null)
...
...
@@ -43,7 +43,7 @@
<option
value=
"-1"
disabled
selected
>
(select)
</option>
@for (var i = 0; i
<
AllToppings.Count
;
i
++)
{
<
option
value=
"@i"
>
@AllToppings[i].Name - (£@(AllToppings[i].
Price.ToString("0.00"
)))
</option>
<
option
value=
"@i"
>
@AllToppings[i].Name - (£@(AllToppings[i].
GetFormattedPrice(
)))
</option>
}
</select>
}
...
...
@@ -60,7 +60,7 @@
{
<div
class=
"topping"
>
@topping.Topping.Name
<span
class=
"topping-price"
>
@topping.Topping.
Price.ToString("0.00"
)
</span>
<span
class=
"topping-price"
>
@topping.Topping.
GetFormattedPrice(
)
</span>
<button
type=
"button"
class=
"delete-topping"
onclick=
"@(() => RemoveTopping(topping.Topping))"
>
x
</button>
</div>
}
...
...
@@ -70,7 +70,7 @@
<div
class=
"dialog-buttons px-4"
>
<button
class=
"btn btn-secondary mr-auto"
onclick=
"@OnCancel"
>
Cancel
</button>
<span
class=
"mr-center"
>
Price:
<span
class=
"price"
>
@(Pizza.GetTotalPrice()
.ToString("0.00")
)
</span>
Price:
<span
class=
"price"
>
@(Pizza.Get
Formatted
TotalPrice())
</span>
</span>
<button
class=
"btn btn-success ml-auto"
onclick=
"@OnConfirm"
>
Order >
</button>
</div>
...
...
src/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml
View file @
84e28c1f
...
...
@@ -8,7 +8,7 @@
}
</ul>
<div
class=
"item-price"
>
@Pizza.GetTotalPrice()
.ToString("0.00")
@Pizza.Get
Formatted
TotalPrice()
</div>
</div>
...
...
src/BlazingPizza.Shared/Pizza.cs
View file @
84e28c1f
...
...
@@ -46,6 +46,11 @@ namespace BlazingPizza
return
GetBasePrice
()
+
Toppings
.
Sum
(
t
=>
t
.
Topping
.
Price
);
}
public
string
GetFormattedTotalPrice
()
{
return
GetTotalPrice
().
ToString
(
"0.00"
);
}
public
static
int
GetSizeInInches
(
PizzaSize
size
)
{
switch
(
size
)
...
...
src/BlazingPizza.Shared/Topping.cs
View file @
84e28c1f
...
...
@@ -7,5 +7,7 @@
public
string
Name
{
get
;
set
;
}
public
decimal
Price
{
get
;
set
;
}
public
string
GetFormattedPrice
()
=>
Price
.
ToString
(
"0.00"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment