public ActionResult DeleteConfirmed(int id)
        {
            StaffPassportModels staffPassportModels = db.StaffPassportModels.Find(id);

            db.StaffPassportModels.Remove(staffPassportModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,ContactId,ContractTypeId,ContractEndDate,ResearchPassportExpiry,ResearchPassportRenewal,TypeofAccessId,AccessExpiryDate")] StaffPassportModels staffPassportModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staffPassportModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TypeofAccessId = new SelectList(db.AccessTypesModels.Where(d => d.Deleted == null), "Id", "AccessName", staffPassportModels.TypeofAccessId);
     ViewBag.ContactId      = new SelectList(db.ContactsModels, "Id", "ContactName", staffPassportModels.ContactId);
     ViewBag.ContractTypeId = new SelectList(db.ContractTypesModels.Where(d => d.Deleted == null), "Id", "ContractTypeName", staffPassportModels.ContractTypeId);
     return(View(staffPassportModels));
 }
        // GET: StaffPassport/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StaffPassportModels staffPassportModels = db.StaffPassportModels.Find(id);

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


            if (staffPassportModels == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TypeofAccessId = new SelectList(db.AccessTypesModels.Where(d => d.Deleted == null), "Id", "AccessName", staffPassportModels.TypeofAccessId);
            ViewBag.ContactId      = new SelectList(db.ContactsModels, "Id", "ContactName", staffPassportModels.ContactId);
            ViewBag.ContractTypeId = new SelectList(db.ContractTypesModels.Where(d => d.Deleted == null), "Id", "ContractTypeName", staffPassportModels.ContractTypeId);
            return(View(staffPassportModels));
        }