public async Task <IActionResult> Edit(int id, [Bind("LoaiChiPhiId,LoaiChiPhiTen,LoaiChiPhiMoTa,NgayTao")] TourLoaiChiPhi tourLoaiChiPhi) { if (id != tourLoaiChiPhi.LoaiChiPhiId) { return(NotFound()); } if (ModelState.IsValid) { try { context.Update(tourLoaiChiPhi); await context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TourLoaiChiPhiExists(tourLoaiChiPhi.LoaiChiPhiId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tourLoaiChiPhi)); }
public async Task <IActionResult> Create([Bind("LoaiChiPhiId,LoaiChiPhiTen,LoaiChiPhiMoTa,NgayTao")] TourLoaiChiPhi tourLoaiChiPhi) { if (ModelState.IsValid) { context.Add(tourLoaiChiPhi); await context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tourLoaiChiPhi)); }