public async Task <IActionResult> Edit(string id, [Bind("PartNumber,Description")] ProduksiStringID produksiStringID) { if (id != produksiStringID.PartNumber) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(produksiStringID); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProduksiStringIDExists(produksiStringID.PartNumber)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(produksiStringID)); }
public async Task <IActionResult> Create([Bind("PartNumber,Description")] ProduksiStringID produksiStringID) { if (ModelState.IsValid) { _context.Add(produksiStringID); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(produksiStringID)); }