public OrderSnapshotViewModel CreateOrderSnapshotViewModel()
 {
     OrderSnapshot newOrderDetails = new OrderSnapshot();
     InitializeContactInformation(newOrderDetails.ContactInformation);
     InitializeCakeDetail(newOrderDetails.CakeDetail);
     InitializeDeliveryDetail(newOrderDetails.DeliveryDetail);
     return new OrderSnapshotViewModel(_order.Company, newOrderDetails);
 }
 private void NewOrder_Click(object sender, RoutedEventArgs e)
 {
     FrontOfficeViewModel vm = ForView.Unwrap<FrontOfficeViewModel>(this.DataContext);
     if (vm != null)
     {
         NewOrderDialog dialog = new NewOrderDialog();
         OrderSnapshot newOrderDetails = new OrderSnapshot();
         dialog.DataContext = new OrderSnapshotViewModel(vm.Company, newOrderDetails);
         if (dialog.ShowDialog() ?? false)
         {
             vm.NewOrder(newOrderDetails);
         }
     }
 }
 public OrderSnapshotViewModel(Company company, OrderSnapshot orderSnapshot)
 {
     _company = company;
     _orderSnapshot = orderSnapshot;
 }
Ejemplo n.º 4
0
 public void NewOrder(OrderSnapshot newOrderDetails)
 {
     Order order = _company.NewOrder();
     order.SetCurrentContactInformation(
         newOrderDetails.ContactInformation.Name,
         newOrderDetails.ContactInformation.PhoneNumber);
     order.SetCurrentCakeDetails(
         newOrderDetails.CakeDetail.Size,
         newOrderDetails.CakeDetail.CakeFlavor,
         newOrderDetails.CakeDetail.FrostingFlavor,
         newOrderDetails.CakeDetail.MainColor,
         newOrderDetails.CakeDetail.DecorationColor,
         newOrderDetails.CakeDetail.Message,
         newOrderDetails.CakeDetail.CakeInstructions);
     order.SetCurrentDeliveryDetails(
         newOrderDetails.DeliveryDetail.City,
         newOrderDetails.DeliveryDetail.StreetAddress,
         newOrderDetails.DeliveryDetail.ExpectedDeliveryDate,
         newOrderDetails.DeliveryDetail.DeliveryInstructions);
     _navigation.SelectedOrder = order;
 }