public ActionResult DeleteConfirmed(int id)
        {
            Staff_Clearance staff_Clearance = db.Staff_Clearances.Find(id);

            db.Staff_Clearances.Remove(staff_Clearance);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: Staff_Clearance/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Staff_Clearance staff_Clearance = db.Staff_Clearances.Find(id);

            if (staff_Clearance == null)
            {
                return(HttpNotFound());
            }
            return(View(staff_Clearance));
        }
 public ActionResult Create([Bind(Include = "ID,Staff_ID,Security_Clearance_ID,Date_Authorized,Contract_ID,Created_On,Created_By,Modified_On,Modified_By")] Staff_Clearance staff_Clearance)
 {
     if (ModelState.IsValid)
     {
         db.Staff_Clearances.Add(staff_Clearance);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DateTime = DateTime.Now;
     ViewBag.Staff_ID = new SelectList(db.Staffs, "ID", "Staff_Name", staff_Clearance.Staff_ID);
     ViewBag.Security_Clearance_ID = new SelectList(db.Adm_Security_Clearances, "ID", "Security_Clearance", staff_Clearance.Security_Clearance_ID);
     ViewBag.Contract_ID           = new SelectList(db.Contracts, "ID", "Title", staff_Clearance.Contract_ID);
     ViewBag.ID = new SelectList(db.Staffs, "ID", "Staff_Name", staff_Clearance.ID);
     return(View(staff_Clearance));
 }
        // GET: Staff_Clearance/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Staff_Clearance staff_Clearance = db.Staff_Clearances.Find(id);

            if (staff_Clearance == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DateTime = DateTime.Now;
            ViewBag.Staff_ID = new SelectList(db.Staffs, "ID", "Staff_Name", staff_Clearance.Staff_ID);
            ViewBag.Security_Clearance_ID = new SelectList(db.Adm_Security_Clearances, "ID", "Security_Clearance", staff_Clearance.Security_Clearance_ID);
            ViewBag.Contract_ID           = new SelectList(db.Contracts, "ID", "Title", staff_Clearance.Contract_ID);
            ViewBag.ID = new SelectList(db.Staffs, "ID", "Staff_Name", staff_Clearance.ID);
            return(View(staff_Clearance));
        }