public void SelectAllItems(ICollectionView availableItemsCollectionView) { var itemVM = _returnItemVmFactory.GetViewModelInstance(); itemVM.IsBulkReturn = true; var confirmation = new ConditionalConfirmation { Title = "Specify return reason".Localize(), Content = itemVM }; ReturnItemConfirmRequest.Raise(confirmation, (x) => { if (x.Confirmed) { var itemsList = new List <ReturnBuilder.ReturnLineItem>(availableItemsCollectionView.Cast <ReturnBuilder.ReturnLineItem>()); foreach (var obj in itemsList) { ReturnBuilder.AddReturnItem(obj, obj.LineItem.Quantity, itemVM.SelectedReason); } OnPropertyChanged("ReturnTotal"); OnIsValidChanged(); } }); }
private void RaiseShippingAddressCreateInteractionRequest() { var item = CreateEntity <OrderAddress>(); var itemVM = _addressVmFactory.GetViewModelInstance(new KeyValuePair <string, object>("addressItem", item)); var confirmation = new ConditionalConfirmation(item.Validate) { Title = "New order address".Localize(), Content = itemVM }; ReturnItemConfirmRequest.Raise(confirmation, (x) => { if (x.Confirmed) { ExchangeOrder.OrderAddresses.Add(item); ShippingAddress = item; } }); }
public void SelectItem(object selectedObj) { var itemVM = _returnItemVmFactory.GetViewModelInstance(); itemVM.ReturnLineItem = selectedObj as ReturnBuilder.ReturnLineItem; var confirmation = new ConditionalConfirmation { Title = "Specify return data".Localize(), Content = itemVM }; ReturnItemConfirmRequest.Raise(confirmation, (x) => { if (x.Confirmed) { ReturnBuilder.AddReturnItem(itemVM.ReturnLineItem, itemVM.QuantityToMove, itemVM.SelectedReason); // recalculate // OnPropertyChanged("ReturnTotal"); OnIsValidChanged(); } }); }