public async Task <IActionResult> Edit(int id, [Bind("Id,Branch_Name,Email,Phone_Number,Address")] Hotel_Detail hotel_Detail) { if (id != hotel_Detail.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hotel_Detail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Hotel_DetailExists(hotel_Detail.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hotel_Detail)); }
public async Task <IActionResult> Create([Bind("Id,Branch_Name,Email,Phone_Number,Address")] Hotel_Detail hotel_Detail) { if (ModelState.IsValid) { _context.Add(hotel_Detail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hotel_Detail)); }