public async Task <IActionResult> Edit(int id, [Bind("SukienId,SukienNgaygio,SukienDiachi,SukienMota")] TbSuKien tbSuKien) { if (id != tbSuKien.SukienId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tbSuKien); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbSuKienExists(tbSuKien.SukienId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tbSuKien)); }
public async Task <IActionResult> Create([Bind("SukienId,SukienNgaygio,SukienDiachi,SukienMota")] TbSuKien tbSuKien) { if (ModelState.IsValid) { _context.Add(tbSuKien); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tbSuKien)); }