public CustomerOrderWindow(OrderVM currentOrder,
                            OrderService orderService,
                            CustomerService customerService,
                            OrderItemService orderItemService,
                            InventoryItemService inventoryService,
                            MainWindowVM mainVM,
                            EventAggregator eventAggregator)
     : this()
 {
     var order = new Order()
     {
         ID = currentOrder.ID,
         CustomerID = currentOrder.CustomerID,
         OrderDate = currentOrder.OrderDate,
     };
     var vm = new CustomerOrderVM(eventAggregator, order, orderService, orderItemService, inventoryService, mainVM);
     vm.RefreshCommand.Execute(null);
     DataContext = vm;
 }
예제 #2
0
 public async Task<Order> UpdateAsync(Order entity)
 {
     return Update(entity);
 }
예제 #3
0
 public async Task<Order> InsertAsync(Order entity)
 {
     return Insert(entity);
 }
예제 #4
0
 public Order Update(Order entity)
 {
     Debug.WriteLine("UPDATING order in database");
     var existing = Orders.First(c => c.ID == entity.ID);
     Mapper.Map(entity, existing);
     return entity;
 }
예제 #5
0
 public Order Insert(Order entity)
 {
     Debug.WriteLine("INSERTING order into database");
     var nextID = Orders.Any() ? Orders.Max(c => c.ID) + 1 : 1;
     entity.ID = nextID;
     Orders.Add(Mapper.Map(entity, new Order()));
     return entity;
 }