Exemplo n.º 1
0
        public void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            var primalCutsView = new PrimalCutsList(_labelService.GetPrimals(selectedItem.SpeciesId, selectedItem.OrderId), this)
            {
            };

            primalCutsView.Closed += (o, args) =>
            {
                if (this.PrimalCutId != null)
                {
                    var cutProducts = _labelService.GetCustomProducts(selectedItem.BaseSpecies, selectedItem.OrderId,
                                                                      PrimalCutId.GetValueOrDefault());
                    if (!cutProducts.Any())
                    {
                        return;
                    }
                    var orderProductsView = new OrderProducts(cutProducts, this);
                    orderProductsView.Closed += (o_, args_) =>
                    {
                        if (CutItem != null)
                        {
                            CutItemName.Content = CutItem.ProductName;
                            CutItemChanged(new ListViewItem()
                            {
                                Content = CutItem
                            });
                        }
                        PrimalCutId = null;
                    };
                    orderProductsView.ShowDialog();
                }
            };
            primalCutsView.ShowDialog();
        }
Exemplo n.º 2
0
 public void BackOrderProducts(OrderProducts products)
 {
     products.Close();
     ButtonBase_OnClick(new object(), new RoutedEventArgs());
 }