コード例 #1
0
        public async Task <ActionResult <Registrovani> > PostRegistrovani(Registrovani registrovani)
        {
            _context.Registrovani.Add(registrovani);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRegistrovani", new { id = registrovani.Id }, registrovani));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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();
        }
コード例 #5
0
 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());
 }