public async Task <IActionResult> Edit(int id, [Bind("BioSampleId,RackNumber,BagNumber,LowPairNs,HighPairNs,BurialLocationNs,LowPairEw,HighPairEw,BurialLocationEw,BurialSubplot,BurialNumber,Date,PreviouslySampled,Notes,Initials,BurialId")] BioSamples bioSamples) { if (id != bioSamples.BioSampleId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bioSamples); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BioSamplesExists(bioSamples.BioSampleId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BurialId"] = new SelectList(_context.Set <Burials>(), "BurialId", "BurialId", bioSamples.BurialId); return(View(bioSamples)); }
public async Task <IActionResult> Create([Bind("BioSampleId,RackNumber,BagNumber,LowPairNs,HighPairNs,BurialLocationNs,LowPairEw,HighPairEw,BurialLocationEw,BurialSubplot,BurialNumber,Date,PreviouslySampled,Notes,Initials,BurialId")] BioSamples bioSamples) { if (ModelState.IsValid) { _context.Add(bioSamples); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BurialId"] = new SelectList(_context.Set <Burials>(), "BurialId", "BurialId", bioSamples.BurialId); return(View(bioSamples)); }