public async Task <IActionResult> PutStichprobe(int id, Stichprobe stichprobe)
        {
            if (id != stichprobe.StichprobeId)
            {
                return(BadRequest());
            }

            _context.Entry(stichprobe).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StichprobeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutArtikel(int id, Artikel artikel)
        {
            if (id != artikel.ArtikelId)
            {
                return(BadRequest());
            }

            _context.Entry(artikel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ArtikelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("StichprobeId,Name,Abgabedatum,Gefahrengut")] Stichprobe stichprobe)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stichprobe);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stichprobe));
            //return View("en",stichprobe);
            // return View("de", stichprobe);
        }