public void OnOrderItemAddedMeetingRoom(object arg) { DrinkOrderItem orderItem = (DrinkOrderItem)arg; bool successControler = false; if (orderItem != null) { try { OrderItemsList.Add(orderItem); successControler = true; base.RaisePropertyChanged("OrderItemsList"); //throw new Exception("test exception"); } catch (Exception ex) { successControler = false; } } else { successControler = false; } if (successControler) { Mediator.NotifyColleagues(MessageConstants.NotifyMessengerBroker.Value, MessageConstants.SuccessToken); } else { Mediator.NotifyColleagues(MessageConstants.NotifyMessengerBroker.Value, MessageConstants.FailureToken); } }
public void ShowConfigureDrinkDialog(Drink drink) { ConfiguringDrink = new DrinkOrderItem() { Drink = drink, DrinkId = drink.Id }; ShowingDrinkDialog = true; }
private void OnOrderItemInsert() { //SelectedDrinkType = null; if (SelectedDrinkType != null && SelectedOrderNumber != null) { LoadingShow = true; LoadingShowOpacity = 1; AnimationState = "End"; try { DrinkOrderItem item = new DrinkOrderItem { DrinkAttrName = selectedDrinkType.PropertyName, DrinkAttrID = selectedDrinkType.Id, DrinkTypePrice = selectedDrinkType.Price, DrinkOrderNumberName = selectedOrderNumber.Name, DrinkOrderNumberID = selectedOrderNumber.Id, DrinkTypeName = name, DrinkTypeID = drinkTypeID, }; SelectedDrinkType = null; SelectedOrderNumber = null; NotifySuccessMessageShow = true; //selectedDrinkType = ColdDrinksAttr[0]; //RaisePropertyChanged("SelectedDrinkType"); //AttrSelectedIndex = -1; //System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => { RaisePropertyChanged("SelectedDrinkType"); }), null); Mediator.NotifyColleagues("OrderItemAddedHotDrinks", item); } catch (Exception ex) { SelectedDrinkType = null; SelectedOrderNumber = null; NotifyFailureMessageShow = true; Mediator.NotifyColleagues(MessageConstants.NotifyMessengerBroker.Value, MessageConstants.FailureToken.Value); } } else { NotifyFailureMessageShow = true; SelectedDrinkType = null; SelectedOrderNumber = null; Mediator.NotifyColleagues(MessageConstants.NotifyMessengerBroker.Value, MessageConstants.FailureToken); } }
public void RemoveConfiguredDrink(DrinkOrderItem drink) { Order.Drinks.Remove(drink); }