public async Task <ActionResult> DeleteConfirmed(int id) { AllLesson allLesson = await db.AllLessons.FindAsync(id); db.AllLessons.Remove(allLesson); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Chid,Cid,Name")] AllLesson allLesson) { if (ModelState.IsValid) { db.Entry(allLesson).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.Cid = new SelectList(db.FullCourses, "Cid", "Name", allLesson.Cid); return(View(allLesson)); }
// GET: Auth/AllLessons/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AllLesson allLesson = await db.AllLessons.FindAsync(id); if (allLesson == null) { return(HttpNotFound()); } return(View(allLesson)); }
// GET: Auth/AllLessons/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AllLesson allLesson = await db.AllLessons.FindAsync(id); if (allLesson == null) { return(HttpNotFound()); } ViewBag.Cid = new SelectList(db.FullCourses, "Cid", "Name", allLesson.Cid); return(View(allLesson)); }