public async Task <IActionResult> Edit(int id, [Bind("StudentID,SobaID,BrojBonova,PrijavaStudentaID")] Student student) { if (id != student.StudentID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(student); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(student.StudentID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PrijavaStudentaID"] = new SelectList(_context.PrijavaStudenta, "PrijavaStudentaID", "PrijavaStudentaID", student.PrijavaStudentaID); ViewData["SobaID"] = new SelectList(_context.Soba, "SobaID", "SobaID", student.SobaID); return(View(student)); }
public async Task <IActionResult> Edit(int id, [Bind("SobaID,BrojSobe,Zauzeta,Sprat")] Soba soba) { if (id != soba.SobaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(soba); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SobaExists(soba.SobaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(soba)); }
public async Task <IActionResult> Edit(int id, [Bind("PrijavaKvaraID,StudentID,TipKvara,OpisKvara,VrijemePrijave,VrijemeRjesenja,HitanKvar,Rijeseno")] PrijavaKvara prijavaKvara) { if (id != prijavaKvara.PrijavaKvaraID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prijavaKvara); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrijavaKvaraExists(prijavaKvara.PrijavaKvaraID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["StudentID"] = new SelectList(_context.Student, "StudentID", "StudentID", prijavaKvara.StudentID); return(View(prijavaKvara)); }
public async Task <IActionResult> Edit(int id, [Bind("PrijavaStudentaID,ImePrezime,JMBG,AdresaStanovanja,Fakultet,GodinaStudiranja,CiklusStudija,BrojIndeksa,BrojTelefona,Email,Fotografija")] PrijavaStudenta prijavaStudenta) { if (id != prijavaStudenta.PrijavaStudentaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prijavaStudenta); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrijavaStudentaExists(prijavaStudenta.PrijavaStudentaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(prijavaStudenta)); }
public async Task <IActionResult> Edit(int id, [Bind("PrijavaObrokaID,StudentID,Rucak,Vecera,ZaPonijetRucak,ZaPonijetVecera")] PrijavaObroka prijavaObroka) { if (id != prijavaObroka.PrijavaObrokaID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prijavaObroka); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrijavaObrokaExists(prijavaObroka.PrijavaObrokaID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["StudentID"] = new SelectList(_context.Student, "StudentID", "StudentID", prijavaObroka.StudentID); return(View(prijavaObroka)); }