コード例 #1
0
        public async Task <IActionResult> Placanje(NarudzbaPlacanjeVM nacinPlacanja)
        {
            NarudzbaUpdateRequest updateRequest = new NarudzbaUpdateRequest();

            if (nacinPlacanja.NazivPlacanja == "Pouzećem")
            {
                updateRequest = new NarudzbaUpdateRequest
                {
                    NazivPlacanja = nacinPlacanja.NazivPlacanja,
                };
            }
            else if (nacinPlacanja.NazivPlacanja == "Karticom")
            {
                if (ModelState.IsValid)
                {
                    updateRequest = new NarudzbaUpdateRequest
                    {
                        NazivPlacanja = nacinPlacanja.NazivPlacanja,
                        BrojKartice   = nacinPlacanja.BrojKartice,
                        CVV           = nacinPlacanja.CVV
                    };
                }
                else
                {
                    return(View(nacinPlacanja));
                }
            }

            await _restoranApi.UpdateNarudzbaAsync(nacinPlacanja.NarudzbaID, updateRequest);

            return(RedirectToAction("UspjesnaNarudzba"));
        }
コード例 #2
0
        public IActionResult Placanje(int id)
        {
            NarudzbaPlacanjeVM m = new NarudzbaPlacanjeVM {
                NarudzbaID = id
            };

            return(View(m));
        }