public ActionResult DeleteConfirmed(int id) { registation registation = db.registations.Find(id); db.registations.Remove(registation); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,firstname,lastname,NIC,course_id,batch_id,telefono")] registation registation) { if (ModelState.IsValid) { db.Entry(registation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.batch_id = new SelectList(db.batches, "id", "batch1", registation.batch_id); ViewBag.course_id = new SelectList(db.courses, "id", "course1", registation.course_id); return(View(registation)); }
public ActionResult Create([Bind(Include = "id,firstname,lastname,nic,course_id,batch_id,telno")] registation registation) { if (ModelState.IsValid) { db.registations.Add(registation); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.batch_id = new SelectList(db.batches, "id", "batch1", registation.batch_id); ViewBag.course_id = new SelectList(db.courses, "id", "course1", registation.course_id); return(View(registation)); }
// GET: registations/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } registation registation = db.registations.Find(id); if (registation == null) { return(HttpNotFound()); } return(View(registation)); }
// GET: registations/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } registation registation = db.registations.Find(id); if (registation == null) { return(HttpNotFound()); } ViewBag.batch_id = new SelectList(db.batches, "id", "batch1", registation.batch_id); ViewBag.course_id = new SelectList(db.courses, "id", "course1", registation.course_id); return(View(registation)); }