TopShelfCustomer/TopShelfCustomer/ViewModels/PaymentViewModel.cs
/// <summary>
/// PlaceOrder:
///
/// Handler for the Place Order
/// button. Called from PlaceOrderCommand
/// Command delegate.
/// </summary>


Handler for the Place Order
button. Called from PlaceOrderCommand
Command delegate.
Handler for the Place Order button . Called from PlaceOrderCommand Command delegate .
void PlaceOrder() {
                OrderReceipt order = new OrderReceipt {     
                    Date = DateTime.Now,
                    DriverName = "George",
                    EmailAddress = UserContainer.CurrentUser.EmailAddress,
                    LastFour = int.Parse( CardNumber.ToString().Substring( CardNumber.ToString().Length - 4 ) ),
                    NumItems = UserContainer.UserCart.Items.Count,
                    Price = UserContainer.UserCart.Price,
                    StoreName = UserContainer.CurrentUser.StoreName };
                UserContainer.Orders.Add( order );          
                App.SetCurrentPage<OrderHistoryView>();
            }
void PlaceOrder ( ) { OrderReceipt order = new OrderReceipt { Date = DateTime . Now , DriverName = " " , EmailAddress = UserContainer . CurrentUser . EmailAddress , LastFour = int . Parse ( CardNumber . ToString ( ) . Substring ( CardNumber . ToString ( ) . Length - 4 ) ) , NumItems = UserContainer . UserCart . Items . Count , Price = UserContainer . UserCart . Price , StoreName = UserContainer . CurrentUser . StoreName } ; UserContainer . Orders . Add ( order ) ; App . SetCurrentPage < OrderHistoryView > ( ) ; }
PlaceOrder:
PlaceOrder :
//Construct OrderReceipt to write to database //Add the new order to the global User instance