public ActionResult DeleteConfirmed(int id)
        {
            carstouser carstouser = db.carstousers.Find(id);

            db.carstousers.Remove(carstouser);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,Car_Id,User_Id")] carstouser carstouser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(carstouser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Car_Id  = new SelectList(db.createcarmodels, "Id", "Placa", carstouser.Car_Id);
     ViewBag.User_Id = new SelectList(db.createusermodels, "Id", "Nombre", carstouser.User_Id);
     return(View(carstouser));
 }
        // GET: carstousers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            carstouser carstouser = db.carstousers.Find(id);

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

            if (carstouser == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Car_Id  = new SelectList(db.createcarmodels, "Id", "Placa", carstouser.Car_Id);
            ViewBag.User_Id = new SelectList(db.createusermodels, "Id", "Nombre", carstouser.User_Id);
            return(View(carstouser));
        }