Exemple #1
0
        public void OpenOrderForm()
        {
            OrderFormWindow orderFormWindow = new OrderFormWindow();

            orderFormWindow.DataContext = OrderFormViewModel;
            orderFormWindow.ShowDialog();
        }
Exemple #2
0
        private void OrderEdit_Click(object sender, RoutedEventArgs e)
        {
            Order order = ((FrameworkElement)sender).DataContext as Order;

            OrderFormWindow orderWindow = new OrderFormWindow(order.Id);

            orderWindow.ShowDialog();

            if (orderWindow.DialogResult.HasValue && orderWindow.DialogResult.Value)
            {
                order = orderWindow.Order;
                PlannerRequester.UpdateOrder(order);
            }

            Refresh();
        }
        public void OpenOrderForm()
        {
            OrderFormWindow orderFormWindow = new OrderFormWindow();

            orderFormWindow.DataContext = OrderFormViewModel;
            if (!(orderFormWindow.ShowDialog() is true))
            {
                if (CurrentOrder.ID == 0)
                {
                    Orders.Remove(CurrentOrder);
                    if (Orders.Count() > 0)
                    {
                        CurrentOrder = Orders.First();
                    }
                    else
                    {
                        CurrentOrder = null;
                    }
                }
            }
        }