private void SubmitOrderExecute() { if (Repository != null && CurrentlySelectedMenuItems != null && CurrentlySelectedMenuItems.Count != 0) { Repository.Orders.Add(new Order { Table = Repository.Tables.First(), Items = CurrentlySelectedMenuItems.ToList() }); CurrentlySelectedMenuItems.Clear(); } }
private void SubmitOrder(object obj) { Order newOrder = new Order(); newOrder.Table = base.Repository.Tables[0]; newOrder.Items = new List <MenuItem>(); newOrder.Items.AddRange(CurrentlySelectedMenuItems); base.Repository.Orders.Add(newOrder); newOrder = null; CurrentlySelectedMenuItems.Clear(); }
private async void SubmitOrder() { Repository.Orders.Add( new Order { Items = CurrentlySelectedMenuItems.ToList(), Table = Repository.Tables.First(), Expedite = false }); CurrentlySelectedMenuItems.Clear(); await new MessageDialog("Order has been submitted").ShowAsync(); }
private void SubmitOrderExecute(string message) { Order NewOrder = new Order { Complete = false, Expedite = false, SpecialRequests = SpecialRequestsText, Table = new Table { Description = "Test table" }, Items = CurrentlySelectedMenuItems.ToList() }; Repository.Orders.Add(NewOrder); new MessageDialog(message).ShowAsync(); CurrentlySelectedMenuItems.Clear(); SpecialRequestsText = String.Empty; }
private void SubmitOrder(object obj) { List <MenuItem> selectedItems = CurrentlySelectedMenuItems.ToList(); var order = new Order(); order.Complete = false; order.SpecialRequests = String.IsNullOrEmpty(Request) ? "N/A" : Request; order.Table = new Table { Description = "Corner" }; order.Items = selectedItems; Repository.Orders.Add(order); Request = String.Empty; CurrentlySelectedMenuItems.Clear(); DisplaypopupMessage(); }
private async void addOrder(object param) { if (CurrentlySelectedMenuItems.Count > 0) { Order newOrder = new Order { Complete = false, Expedite = false, Items = new List <MenuItem>(CurrentlySelectedMenuItems), Table = base.Repository.Tables[0], SpecialRequests = this.CurrentSpecialRequest }; CurrentlySelectedMenuItems.Clear(); CurrentSpecialRequest = String.Empty; NotifyPropertyChanged("CurrentlySelectedMenuItems"); NotifyPropertyChanged("CurrentSpecialRequest"); await new MessageDialog("Order was added").ShowAsync(); base.Repository.Orders.Add(newOrder); } }