Inheritance: ViewModelBase
Beispiel #1
0
 public InventoryItemsVM(InventoryItemService inventoryService, MainWindowVM mainVM)
 {
     _inventoryService = inventoryService;
     _mainVM = mainVM;
     _saveInventoryItemsCommand = new Command(async () => await SaveInventoryItemsAsync());
     _loadInventoryItemsCommand = new Command(async () => await LoadInventoryItemsAsync());
 }
Beispiel #2
0
 public ProductsVM(ProductService productsService, MainWindowVM mainVM)
 {
     _productsService = productsService;
     _mainVM = mainVM;
     _addProductCommand = new Command(() => AddProduct());
     _saveProductsCommand = new Command(async () => await SaveProductsAsync());
     _loadProductsCommand = new Command(async () => await LoadProductsAsync());
     _deleteSelectedCommand = new Command(async () => await DeleteSelectedItemAsync());
 }
Beispiel #3
0
 public OrderVM(CustomerOrderVM order, MainWindowVM vm, OrderService orderService)
 {
     ID = order.ID;
     OrderDate = order.CurrentEntity.OrderDate;
     Customer = vm.CustomersVM.Customers.First(c => c.ID == order.CurrentCustomerID).Name;
     CustomerID = order.CurrentCustomerID;
     Total = order.OrderItems.Sum(i => i.Amount.Value);
     Status = order.Status == null ? string.Empty : order.Status.Name;
     HasShippedItems = order.OrderItems.Any(i => i.Status is ShippedState);
     _orderService = orderService;
 }
 public CustomerOrderWindow(OrderService orderService,
                            CustomerService customerService,
                            OrderItemService orderItemService,
                            InventoryItemService inventoryService,
                            MainWindowVM mainVM,
                            EventAggregator eventAggregator)
     : this()
 {
     var vm = new CustomerOrderVM(eventAggregator, orderService, orderItemService, inventoryService, mainVM);
     DataContext = vm;
 }
 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;
 }
Beispiel #6
0
 public ProductVM(Product product, ProductService service, MainWindowVM mainVM) : base(product, service)
 {
     _mainVM = mainVM;
 }