public ActionResult DeleteConfirmed(int id)
        {
            Complience complience = db.Compliences.Find(id);

            db.Compliences.Remove(complience);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public JsonResult Edit(Complience complience)
 {
     if (ModelState.IsValid)
     {
         db.Entry(complience).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Index");
     }
     ViewBag.TypeID           = new SelectList(db.ComplienceSubTypes, "ID", "Name", complience.SubTypeID);
     ViewBag.ComplienceTypeID = new SelectList(db.ComplienceTypes, "ID", "Class", complience.ComplienceTypeID);
     ViewBag.FleetNo          = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", complience.FleetNo);
     return(Json(complience));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Complience complience = db.Compliences.Find(id);

            if (complience == null)
            {
                return(HttpNotFound());
            }
            return(View(complience));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Complience complience = db.Compliences.Find(id);

            if (complience == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TypeID           = new SelectList(db.ComplienceSubTypes, "ID", "Name", complience.SubTypeID);
            ViewBag.ComplienceTypeID = new SelectList(db.ComplienceTypes, "ID", "Class", complience.ComplienceTypeID);
            ViewBag.FleetNo          = new SelectList(db.FleetAssets, "FleetNo", "RegistrationNo", complience.FleetNo);
            return(View(complience));
        }