public async Task <IActionResult> Edit(int id, [Bind("Id,ProdName,ProdCode,UpdatedDate,UpdatedBy")] HeaProducts heaProducts) { if (id != heaProducts.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(heaProducts); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HeaProductsExists(heaProducts.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(heaProducts)); }
public async Task <IActionResult> Create([Bind("Id,ProdName,ProdCode,UpdatedDate,UpdatedBy")] HeaProducts heaProducts) { if (ModelState.IsValid) { _context.Add(heaProducts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(heaProducts)); }