コード例 #1
0
 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;
 }