Exemplo n.º 1
0
        /// <summary>
        /// Refers to call the View BuyComponent.cshtml
        /// Calls CreateOrder(), and returns all categories on the database
        /// </summary>
        /// <returns>ActionResult view</returns>
        public ActionResult BuyComponent()
        {
            CreateOrder();
            var items = categoryProxy.GetAll();

            return(View(items));
        }
Exemplo n.º 2
0
        public ICollection <CategoryModel> GetCategories()
        {
            var queryResult = _categoryService.GetAll();
            List <CategoryModel> categories = new List <CategoryModel>();

            foreach (var category in queryResult)
            {
                categories.Add(new CategoryModel {
                    Id = category.Id, Name = category.Name, Description = category.Description
                });
            }
            return(categories);
        }
Exemplo n.º 3
0
        public void Initialize()
        {
            _viewModel = new StartPageViewModel
            {
                Categories = _client.GetAll().ToList(),
                CategorySelectedCommand = new RelayCommand(ExecuteCategorySelectedCommand),
                PasswordResetCommand    = new RelayCommand(ExecutePasswordResetCommand)
            };

            Page = new StartPage {
                DataContext = _viewModel,
            };
        }
 private void LoadItems()
 {
     _viewModel.Categories = new ObservableCollection <Category>(_client.GetAll());
 }