This website works better with JavaScript.
Home
Explore
Help
Sign In
ayan.poddar
/
eShopOnContainers
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
19
Wiki
Activity
Browse Source
Merge branch 'dev' of
https://github.com/dotnet/eShopOnContainers
into dev
pull/173/head
Eduard Tomas
7 years ago
parent
5eb5db1b8c
8f34999d66
commit
46fd872fe8
6 changed files
with
45 additions
and
3 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+10
-0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs
+3
-0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs
+2
-0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/BasketViewModel.cs
+3
-2
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs
+11
-0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs
+16
-1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/BasketItemTemplate.xaml
+ 10
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs
View File
@ -15,6 +15,16 @@ namespace eShopOnContainers.Core.Models.Basket
public
decimal
UnitPrice
{
get
;
set
;
}
public
decimal
OldUnitPrice
{
get
;
set
;
}
public
bool
HasNewPrice
{
get
{
return
OldUnitPrice
!
=
0.0
m
;
}
}
public
int
Quantity
{
get
{
return
_quantity
;
}
+ 3
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs
View File
@ -34,6 +34,9 @@ namespace eShopOnContainers.Core.Models.Orders
[JsonProperty("country")]
public
string
ShippingCountry
{
get
;
set
;
}
[JsonProperty("zipCode")]
public
string
ShippingZipCode
{
get
;
set
;
}
public
int
CardTypeId
{
get
;
set
;
}
public
string
CardNumber
{
get
;
set
;
}
+ 2
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/BasketViewModel.cs
View File
@ -78,7 +78,9 @@ namespace eShopOnContainers.Core.ViewModels
if
(
basket
!
=
null
&
&
basket
.
Items
!
=
null
&
&
basket
.
Items
.
Any
(
)
)
{
BadgeCount
=
0
;
BasketItems
.
Clear
(
)
;
foreach
(
var
basketItem
in
basket
.
Items
)
{
BadgeCount
+
=
basketItem
.
Quantity
;
+ 3
- 2
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs
View File
@ -90,7 +90,7 @@ namespace eShopOnContainers.Core.ViewModels
ZipCode
=
userInfo
?
.
ZipCode
,
State
=
userInfo
?
.
State
,
Country
=
userInfo
?
.
Country
,
City
=
string
.
Empty
City
=
userInfo
?
.
Address
}
;
// Create Payment Info
@ -117,7 +117,8 @@ namespace eShopOnContainers.Core.ViewModels
ShippingState
=
_shippingAddress
.
State
,
ShippingCountry
=
_shippingAddress
.
Country
,
ShippingStreet
=
_shippingAddress
.
Street
,
ShippingCity
=
_shippingAddress
.
City
,
ShippingCity
=
_shippingAddress
.
City
,
ShippingZipCode
=
_shippingAddress
.
ZipCode
,
Total
=
CalculateTotal
(
CreateOrderItems
(
orderItems
)
)
}
;
+ 11
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs
View File
@ -44,5 +44,16 @@ namespace eShopOnContainers.Core.Views
await
profileViewModel
.
InitializeAsync
(
null
)
;
ProfileView
.
BindingContext
=
profileViewModel
;
}
protected
override
async
void
OnCurrentPageChanged
(
)
{
base
.
OnCurrentPageChanged
(
)
;
if
(
CurrentPage
is
BasketView
)
{
// Force basket view refresh every time we access it
await
(
BasketView
.
BindingContext
as
ViewModelBase
)
.
InitializeAsync
(
null
)
;
}
}
}
}
+ 16
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/BasketItemTemplate.xaml
View File
@ -83,6 +83,7 @@
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="1" />
</Grid.RowDefinitions>
<!-- IMAGE -->
@ -131,10 +132,24 @@
Text="{Binding Total, StringFormat='${0:N}'}"
Style="{StaticResource OrderTotalStyle}"/>
</Grid>
<Grid
<Grid
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="1"
IsVisible="{Binding HasNewPrice}"
BackgroundColor="#F0AD4E">
<Label
HorizontalOptions="Fill"
VerticalOptions="Fill"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
HeightRequest="60"
Text="{Binding OldUnitPrice, StringFormat='Note that the price of this article changed in our Catalog. The old price when you originally added it to the basket was ${0:N2}'}" />
</Grid>
<Grid
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="2"
BackgroundColor="Gray"/>
</Grid>
</ContentView.Content>
Write
Preview
Loading…
Cancel
Save