Beispiel #1
0
        public IActionResult Index(MachineViewModel vm, string purchase, string restock)
        {
            if (!string.IsNullOrEmpty(purchase))
            {
                _vendingMachineRepo.Purchase(vm.SelectedSlotNumber, vm.SelectedPaymentType == 1 ? Enums.PaymentType.Cash : Enums.PaymentType.CreditCard);
            }
            if (!string.IsNullOrEmpty(restock))
            {
                _vendingMachineRepo.ReStockMachine();
            }

            MachineStatus status = _vendingMachineRepo.GetMachineStatus();

            return(View(MachineViewModel.ConvertFromModel(status)));
        }
Beispiel #2
0
        public IActionResult Index()
        {
            MachineStatus status = _vendingMachineRepo.GetMachineStatus();

            return(View(MachineViewModel.ConvertFromModel(status)));
        }