public async Task <IActionResult> Create([Bind("IdPelayan,Nama,Alamat,Password,JenisKelamin")] Pelayan pelayan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pelayan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pelayan));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdMenu,NamaMakanan,Kategori,Harga")] Menu menu)
        {
            if (ModelState.IsValid)
            {
                _context.Add(menu);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(menu));
        }
        public async Task <IActionResult> Create([Bind("IdOrder,JumlahOrder,IdPelanggan,IdPelayan")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                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> Create([Bind("IdMemilih,IdMenu,IdPelanggan,JumlahPesanan")] Memilih memilih)
        {
            if (ModelState.IsValid)
            {
                _context.Add(memilih);
                await _context.SaveChangesAsync();

                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> Create([Bind("IdTransaksi,NotaPembayaran,IdKasir,IdPelanggan")] Membayar membayar)
        {
            if (ModelState.IsValid)
            {
                _context.Add(membayar);
                await _context.SaveChangesAsync();

                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));
        }