public async Task <IActionResult> Create([Bind("IdGender,NamaGender")] Gender gender) { if (ModelState.IsValid) { _context.Add(gender); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gender)); }
public async Task <IActionResult> Create([Bind("IdJenisKendaraan,NamaJenisKendaraan")] JenisKendaraan jenisKendaraan) { if (ModelState.IsValid) { _context.Add(jenisKendaraan); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jenisKendaraan)); }
public async Task <IActionResult> Create([Bind("IdKondisi,NamaKondisi")] KondisiKendaraan kondisiKendaraan) { if (ModelState.IsValid) { _context.Add(kondisiKendaraan); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(kondisiKendaraan)); }
public async Task <IActionResult> Create([Bind("IdCustomer,NamaCustomer,Nik,Alamat,NoHp,IdGender")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdGender"] = new SelectList(_context.Gender, "IdGender", "IdGender", customer.IdGender); return(View(customer)); }
public async Task <IActionResult> Create([Bind("IdKendaraan,NamaKendaraan,NoPolisi,NoStnk,IdJenisKendaraan,Ketersediaan")] Kendaraan kendaraan) { if (ModelState.IsValid) { _context.Add(kendaraan); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdJenisKendaraan"] = new SelectList(_context.JenisKendaraan, "IdJenisKendaraan", "IdJenisKendaraan", kendaraan.IdJenisKendaraan); return(View(kendaraan)); }
public async Task <IActionResult> Create([Bind("IdPengembalian,TglPengembalian,IdPeminjaman,IdKondisi,Denda")] Pengembalian pengembalian) { if (ModelState.IsValid) { _context.Add(pengembalian); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdKondisi"] = new SelectList(_context.KondisiKendaraan, "IdKondisi", "IdKondisi", pengembalian.IdKondisi); ViewData["IdPeminjaman"] = new SelectList(_context.Peminjaman, "IdPeminjaman", "IdPeminjaman", pengembalian.IdPeminjaman); return(View(pengembalian)); }
public async Task <IActionResult> Create([Bind("IdPeminjaman,TglPeminjaman,IdKendaraan,IdCustomer,IdJaminan,Biaya")] Peminjaman peminjaman) { if (ModelState.IsValid) { _context.Add(peminjaman); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdCustomer"] = new SelectList(_context.Customer, "IdCustomer", "IdCustomer", peminjaman.IdCustomer); ViewData["IdJaminan"] = new SelectList(_context.Jaminan, "IdJaminan", "IdJaminan", peminjaman.IdJaminan); ViewData["IdKendaraan"] = new SelectList(_context.Kendaraan, "IdKendaraan", "IdKendaraan", peminjaman.IdKendaraan); return(View(peminjaman)); }