public async Task <IActionResult> Edit(string id, [Bind("MsKH,TenKH,Nodau")] Khachhang khachhang) { if (id != khachhang.MsKH) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(khachhang); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KhachhangExists(khachhang.MsKH)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(khachhang)); }
public async Task <IActionResult> Edit(string id, [Bind("MsPT,NgayThu,SoTien")] Phieuthu phieuthu) { if (id != phieuthu.MsPT) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(phieuthu); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhieuthuExists(phieuthu.MsPT)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(phieuthu)); }