public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Address,Udobstvo,Rating")] Kino kino) { if (id != kino.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(kino); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KinoExists(kino.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(kino)); }
public ActionResult Kino(Kino kinoModel) { using (KinoContext context = new KinoContext()) { context.KinoComments.Add(kinoModel); context.SaveChanges(); } return(View("Kino", new Kino())); }
public async Task <IActionResult> Create([Bind("ID,Title,Address,Udobstvo,Rating")] Kino kino) { if (ModelState.IsValid) { _context.Add(kino); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(kino)); }
public async Task <IActionResult> Create([Bind("Id,Naziv,Grad")] Kino kino) { if (ModelState.IsValid) { _context.Add(kino); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(kino)); }
public ActionResult Kino(int id = 0) { Kino kinoModel = new Kino(); return(View(kinoModel)); }
/// <summary> /// Metoda wczytująca z pliku obiekt Kino /// </summary> public void Wczytaj() { kino = ZapisOdczyt <Kino> .Deserializacja(path); }