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> Edit(int id, [Bind("StichprobeId,Name,Abgabedatum,Gefahrengut")] Stichprobe stichprobe) { if (id != stichprobe.StichprobeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(stichprobe); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StichprobeExists(stichprobe.StichprobeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(stichprobe)); }
public async Task <ActionResult <Stichprobe> > PostStichprobe(Stichprobe stichprobe) { _context.Stichprobe.Add(stichprobe); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStichprobe", new { id = stichprobe.StichprobeId }, stichprobe)); }
public async Task <ActionResult <Stichprobe> > PostStichprobe(Stichprobe stichprobe) { // if (ModelState.IsValid) { _context.Stichprobe.Add(stichprobe); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStichprobe", new { id = stichprobe.StichprobeId }, stichprobe)); } //return BadRequest(); }
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); }