public async Task <IActionResult> Edit(int id, [Bind("IdPelayan,Nama,Alamat,Password,JenisKelamin")] Pelayan pelayan) { if (id != pelayan.IdPelayan) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pelayan); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PelayanExists(pelayan.IdPelayan)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pelayan)); }
public async Task <IActionResult> Edit(int id, [Bind("IdMenu,NamaMakanan,Kategori,Harga")] Menu menu) { if (id != menu.IdMenu) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(menu); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MenuExists(menu.IdMenu)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(menu)); }
public async Task <IActionResult> Edit(int id, [Bind("IdOrder,JumlahOrder,IdPelanggan,IdPelayan")] Order order) { if (id != order.IdOrder) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(order); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(order.IdOrder)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdPelanggan"] = new SelectList(_context.Pelanggan, "IdPelanggan", "IdPelanggan", order.IdPelanggan); ViewData["IdPelayan"] = new SelectList(_context.Pelayan, "IdPelayan", "IdPelayan", order.IdPelayan); return(View(order)); }
public async Task <IActionResult> Edit(int id, [Bind("IdMemilih,IdMenu,IdPelanggan,JumlahPesanan")] Memilih memilih) { if (id != memilih.IdMemilih) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(memilih); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemilihExists(memilih.IdMemilih)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdMenu"] = new SelectList(_context.Menu, "IdMenu", "IdMenu", memilih.IdMenu); ViewData["IdPelanggan"] = new SelectList(_context.Pelanggan, "IdPelanggan", "IdPelanggan", memilih.IdPelanggan); return(View(memilih)); }
public async Task <IActionResult> Edit(int id, [Bind("IdTransaksi,NotaPembayaran,IdKasir,IdPelanggan")] Membayar membayar) { if (id != membayar.IdTransaksi) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(membayar); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MembayarExists(membayar.IdTransaksi)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdKasir"] = new SelectList(_context.Kasir, "IdKasir", "IdKasir", membayar.IdKasir); ViewData["IdPelanggan"] = new SelectList(_context.Pelanggan, "IdPelanggan", "IdPelanggan", membayar.IdPelanggan); return(View(membayar)); }