public async Task <ActionResult> DeleteConfirmed(int id) { Penilaian penilaian = await db.Penilaians.FindAsync(id); db.Penilaians.Remove(penilaian); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: Penilaian/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Penilaian penilaian = await db.Penilaians.FindAsync(id); if (penilaian == null) { return(HttpNotFound()); } return(View(penilaian)); }
public async Task <ActionResult> Edit([Bind(Include = "IdPenilaian,Username,KodeDesa,IdIndikator,IdKel,Id,Alasan,Skor")] Penilaian penilaian) { if (ModelState.IsValid) { db.Entry(penilaian).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.Username = new SelectList(db.Akuns, "Username", "Email", penilaian.Username); ViewBag.KodeDesa = new SelectList(db.Indikators, "KodeDesa", "Username", penilaian.KodeDesa); ViewBag.IdKel = new SelectList(db.Programs, "IdKel", "NamaProgram", penilaian.IdKel); return(View(penilaian)); }
// GET: Penilaian/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Penilaian penilaian = await db.Penilaians.FindAsync(id); if (penilaian == null) { return(HttpNotFound()); } ViewBag.Username = new SelectList(db.Akuns, "Username", "Email", penilaian.Username); ViewBag.KodeDesa = new SelectList(db.Indikators, "KodeDesa", "Username", penilaian.KodeDesa); ViewBag.IdKel = new SelectList(db.Programs, "IdKel", "NamaProgram", penilaian.IdKel); return(View(penilaian)); }
// GET: Penilaian/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Penilaian penilaian = await db.Penilaians.Where(x => x.IdPenilaian == id.Value).SingleAsync(); List <Komentar> komentars = await db.Komentars.Where(x => x.IdPenilaian == id.Value).ToListAsync(); if (penilaian == null) { return(HttpNotFound()); } ViewBag.penilaian = penilaian; ViewBag.komentars = komentars; return(View()); }