private void OrderBarText_Click(object sender, EventArgs e) { if (!(OrderManager.Instance.GetItem().Sum(x => x.PriceBar * Convert.ToInt32(x.Quantity)) > 0)) { return; } Show(); ThreadPool.QueueUserWorkItem(_ => { OrderManager.Instance.AddOrder(Models.DTO.OrderType.Bar, (obj) => { if (App.Instance.GetView(typeof(OrderBarViewModel)) is OrderBarViewModel a) { a.TableNumber = obj.ToString(); } TableNumber = obj.ToString(); GetPayment?.Invoke(Verify); Hide(); }, (obj) => { ShowError(obj.Replace(",", Environment.NewLine).Trim()); }); }); }
private void ConfirmText_Click(object sender, EventArgs e) { if (OrderManager.Instance.OrderType != OrderVisibility.Local || !(OrderManager.Instance.GetItem().Sum(x => x.Price * Convert.ToInt32(x.Quantity)) > 0)) { return; } Show(); ThreadPool.QueueUserWorkItem(_ => { OrderManager.Instance.AddOrder(Models.DTO.OrderType.Table, (obj) => { TableNumber = obj.ToString(); GetPayment?.Invoke(Verify); }, (obj) => { ShowError(obj); }, TableNumber); }); }