public async Task <IActionResult> Edit(int id, [Bind("Id,HotelName,Address,Booking_id,Guest_No,StartDate,EndDate,Room_No")] HotelBoeking hotelBoeking) { if (id != hotelBoeking.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hotelBoeking); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HotelBoekingExists(hotelBoeking.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hotelBoeking)); }
public IActionResult Edit(HotelBoeking h) { _context.HotelBoekingen.Attach(h); var boeking = _context.Entry(h); boeking.State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Wijzigen", h)); }
public async Task <IActionResult> Create([Bind("Id,HotelName,Address,Booking_id,Guest_No,StartDate,EndDate,Room_No")] HotelBoeking hotelBoeking) { if (ModelState.IsValid) { _context.Add(hotelBoeking); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hotelBoeking)); }
public IActionResult EditBoeking(int id) { HotelBoeking hotel = null; foreach (HotelBoeking getHotel in HotelBoeking.AllBoeking) { if (getHotel.BoekingID == id) { hotel = getHotel; } } return(View(hotel)); }
public IActionResult AddBoeking(string name, double price, DateTime date) { HotelBoeking boeking = new HotelBoeking() { Name = name, Price = price, Date = date }; HotelBoeking.AllBoeking.Add(boeking); TempData["status"] = "Boeking " + boeking.Name + " is toegevoegd."; return(RedirectToAction("index")); }
public IActionResult Create(HotelBoeking h) { _context.HotelBoekingen.Add(h); _context.SaveChanges(); return(RedirectToAction("Verwerken", h)); }
public IActionResult Edit(int id) { HotelBoeking h = _context.HotelBoekingen.Where(b => b.HotelBoekingId == id).First(); return(View(h)); }
public IActionResult Wijzigen(HotelBoeking h) { return(View(h)); }
public IActionResult Verwerken(HotelBoeking h) { return(View(h)); }