Exemplo n.º 1
0
        public IActionResult SoldAction(int id)
        {
            var assetItem = _assets.GetById(id);
            //Design choice: I'm prefilling the form with expected inputs for qty,date & marketplace. Depending on user feedback this could change
            var model = new SoldActionItemModel {
                productId = id,
                Name      = assetItem.Title,
                Sizes     = "",
                Qty       = 1,
                Date      = DateTime.Today.ToShortDateString(),
                ImageUrl  = assetItem.ImageUrl,
                Market    = _assets.GetMarketCategory(id).MarketPlaceName,
            };

            return(View(model));
        }
Exemplo n.º 2
0
 public IActionResult SoldSubmit(int productId, SoldActionItemModel itemToAdd)
 {
     _soldHistory.SubmitSold(productId, itemToAdd.Date, itemToAdd.Qty, itemToAdd.Sizes, itemToAdd.Market);
     return(RedirectToAction("ProductPage", new { id = productId }));
 }