public ActionResult DeleteConfirmed(int id)
        {
            Admit_Card admit_Card = db.Admit_Cards.Find(id);

            db.Admit_Cards.Remove(admit_Card);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "School_Code,GuardianID,Roll_Number")] Admit_Card admit_Card)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admit_Card).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Roll_Number = new SelectList(db.Candidates, "Roll_Number", "Gender", admit_Card.Roll_Number);
     ViewBag.GuardianID  = new SelectList(db.Guardians, "GuardianID", "GuardianID", admit_Card.GuardianID);
     ViewBag.School_Code = new SelectList(db.Schools, "School_Code", "Name", admit_Card.School_Code);
     return(View(admit_Card));
 }
        // GET: Admin/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Admit_Card admit_Card = db.Admit_Cards.Find(id);

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

            if (admit_Card == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Roll_Number = new SelectList(db.Candidates, "Roll_Number", "Gender", admit_Card.Roll_Number);
            ViewBag.GuardianID  = new SelectList(db.Guardians, "GuardianID", "GuardianID", admit_Card.GuardianID);
            ViewBag.School_Code = new SelectList(db.Schools, "School_Code", "Name", admit_Card.School_Code);
            return(View(admit_Card));
        }