public async Task <ActionResult <Registrovani> > PostRegistrovani(Registrovani registrovani) { _context.Registrovani.Add(registrovani); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRegistrovani", new { id = registrovani.Id }, registrovani)); }
public async Task <IActionResult> Edit(int id, [Bind("Spol,Ime,DatumRodjenja,Visina,Tezina,Username,Password")] Registrovani registrovani) { if (id != registrovani.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(registrovani); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegistrovaniExists(registrovani.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(registrovani)); }
public async Task <IActionResult> Create([Bind("Spol,Ime,DatumRodjenja,Visina,Tezina,Username,Password")] Registrovani registrovani) { if (ModelState.IsValid) { _context.Add(registrovani); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(registrovani)); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Registrovani r = new Registrovani(); List <Korisnik> registrov = new List <Korisnik>(); Voznje sveVoznje = new Voznje(); Ucitavanje(); }
public async Task <IActionResult> PutRegistrovani(int id, Registrovani registrovani) { if (id != registrovani.Id) { return(BadRequest()); } _context.Entry(registrovani).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegistrovaniExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }