private void OnOrderAddedToRepository(object sender, OrderAddedEventArgs e)
 {
     OrderViewModel viewModel = new OrderViewModel(e.NewOrder);
     OrderViewModel ovm = orders.FirstOrDefault(o => o.Id == viewModel.Id);
     if (ovm != null)
     {
         if (!ovm.OrderModelObject.Equals(viewModel.OrderModelObject))
         {
             orders.Remove(ovm);
             orders.Insert(0, viewModel);
         }
     }
     else
         orders.Add(viewModel);
 }
Beispiel #2
0
 protected void OnOrderAdded(OrderAddedEventArgs e)
 {
     if (OrderAdded != null)
         OrderAdded(this, e);
 }