Exemplo n.º 1
0
 public OrdersViewModel()
 {
     AllCategories = ComboBoxService.GetOptions(ComboBoxTargets.ProductCategories);
     AllCategories.Add(new NameID
     {
         Name = "All",
         ID   = -1
     });
     CurrentCategory = AllCategories.Last();
 }
Exemplo n.º 2
0
 public OrderFormViewModel()
 {
     Order           = StateService.CurrentOrder;
     AllCustomers    = ComboBoxService.GetOptions(ComboBoxTargets.Customers);
     CurrentCustomer = AllCustomers.FirstOrDefault(x => x.ID == Order.CustomerID);
     AllEmployees    = ComboBoxService.GetOptions(ComboBoxTargets.Employees);
     CurrentEmployee = AllEmployees.FirstOrDefault(x => x.ID == Order.EmployeeID);
     AllProducts     = ComboBoxService.GetOptions(ComboBoxTargets.Products);
     CurrentProduct  = AllProducts.FirstOrDefault(x => x.ID == Order.ProductID);
 }
 public ProductFormViewModel()
 {
     Product         = StateService.CurrentProduct;
     AllCategories   = ComboBoxService.GetOptions(ComboBoxTargets.ProductCategories);
     CurrentCategory = AllCategories.FirstOrDefault(x => x.ID == Product.CategoryID);
 }