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")); }
public IActionResult Placanje(int id) { NarudzbaPlacanjeVM m = new NarudzbaPlacanjeVM { NarudzbaID = id }; return(View(m)); }