Example #1
0
 private void OnOrderUpdated(object sender, Support.OrderEventArgs e)
 {
     Close();
 }
        void CurrentOrderViewModel_OrderUpdated(object sender, OrderEventArgs e)
        {
            if (!e.IsNew)
            {
                Order order = _orders.Single(item => item.Id == e.Order.Id);
                if (order != null)
                {
                    order.Date = e.Order.Date;
                    order.Notes = e.Order.Notes;
                    order.DeliveryDate = e.Order.DeliveryDate;
                    order.EstimatedDeliveryDate = e.Order.EstimatedDeliveryDate;
                    order.InvoiceNumber = e.Order.InvoiceNumber;
                    order.Supplier = e.Order.Supplier;
                    order.SupplierId = e.Order.SupplierId;
                    //ToDo decide if need to copy all order items
                    //order.Items = e.Order.Items;
                }
            }
            else
                _orders.Add(e.Order);

            CurrentOrderViewModel = null;
        }