public async Task <IActionResult> Edit(int id, [Bind("Id,TenRapChieu,TongSoPhong,ThanhPho,QuanHuyen")] RapChieuPhimModel rapChieuPhimModel) { if (id != rapChieuPhimModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rapChieuPhimModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RapChieuPhimModelExists(rapChieuPhimModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rapChieuPhimModel)); }
public async Task <IActionResult> Create([Bind("Id,TenRapChieu,TongSoPhong,ThanhPho,QuanHuyen")] RapChieuPhimModel rapChieuPhimModel) { if (ModelState.IsValid) { _context.Add(rapChieuPhimModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rapChieuPhimModel)); }