Esempio n. 1
0
        public EditProductViewModel(Product product) : base(product)
        {
            EditEnabled = true;
            Validator   = new Validation.ProductValidator(this);

            if (Model.IsNew)
            {
                DisplayName = "Uusi tuote";
                Tax         = MainMenuViewModel.SelectedCompany.Tax.ToString();
            }
            else
            {
                DisplayName = "Muokkaa tuotetta " + Name;
            }

            Price = Model.Price.ToString("0.00");

            GroupList = new ProductGroupListViewModel(Resources.GetModels <ProductGroup>());

            if (product.Group != null)
            {
                GroupList.SelectedItem = GroupList.FindByID(product.Group.ID);
            }

            GroupList.SelectionChanged += GroupList_SelectionChanged;
        }
        public AllProductsViewModel()
        {
            DisplayName = "Tuotteet";

            ProductList = new ProductListViewModel(Resources.GetModels <Product>());

            ProductFilter      = new ProductFilterViewModel();
            ProductList.Filter = ProductFilter;

            GroupList = new ProductGroupListViewModel(Resources.GetModels <ProductGroup>());
            GroupList.SelectionChanged += GroupChanged;
        }