Ejemplo n.º 1
0
        public PartialViewResult InventoryProcessor([FromBody] IEnumerable <InventoryPagePostModel> model)
        {
            var inventory = new List <InventoryItem>();
            var settings  = new InventoryPageSettings();

            //extract models
            foreach (var item in model)
            {
                //extract settings
                foreach (var set in item.Settings)
                {
                    settings = set;
                }

                //extract settings
                foreach (var inv in item.Inventory)
                {
                    inventory.Add(inv);
                }
            }

            //process the day
            inventory = InventoryModel.ProcessInventory(settings.DayIncrement, settings.Concert, inventory);

            var pageModel = new InventoryPageModel()
            {
                Settings  = settings,
                Inventory = inventory
            };

            return(PartialView("~/Views/Home/_IndexContent.cshtml", pageModel));
        }
Ejemplo n.º 2
0
        public IActionResult Index()
        {
            //load day with inventory
            var model = InventoryPageModel.New();

            return(View(model));
        }