public ActionResult DeleteConfirmed(int id)
        {
            resistration resistration = db.resistrations.Find(id);

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

            if (resistration == null)
            {
                return(HttpNotFound());
            }
            return(View(resistration));
        }
        // GET: Resistration/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            resistration resistration = db.resistrations.Find(id);

            if (resistration == null)
            {
                return(HttpNotFound());
            }
            ViewBag.batch_id  = new SelectList(db.batches, "id", "batch1", resistration.batch_id);
            ViewBag.course_id = new SelectList(db.courses, "id", "course1", resistration.course_id);
            return(View(resistration));
        }