Exemplo n.º 1
0
        public IActionResult Index()
        {
            ShowAllItemsViewModel model = new ShowAllItemsViewModel();

            model.Items = _itemFactory.ItemCollection().GetAllItems();
            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult SaveEdit(ShowAllItemsViewModel model)
        {
            IItemCollection accountCollection = _itemFactory.ItemCollection();

            accountCollection.Update(new Item(model.Name, model.Description, model.Type, model.Unique));

            return(RedirectToAction("Index", "Item"));
        }
Exemplo n.º 3
0
        public IActionResult Edit(string name)
        {
            Item item = _itemFactory.ItemCollection().GetByName(name);

            ShowAllItemsViewModel model = new ShowAllItemsViewModel()
            {
                Name        = item.Name,
                Description = item.Description,
                Type        = item.Type,
                Unique      = item.Unique
            };

            return(View(model));
        }