public ActionResult DeleteConfirmed(int id)
        {
            PiHardware piHardware = db.PiHardwares.Find(id);

            db.PiHardwares.Remove(piHardware);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "PiHardwareId,Mac,Password,PiModelId")] PiHardware piHardware)
 {
     if (ModelState.IsValid)
     {
         db.Entry(piHardware).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PiModelId = new SelectList(db.PiModels, "PiModelId", "ModelName", piHardware.PiModelId);
     return(View(piHardware));
 }
        // GET: PiHardwares/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PiHardware piHardware = db.PiHardwares.Find(id);

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

            if (piHardware == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PiModelId = new SelectList(db.PiModels, "PiModelId", "ModelName", piHardware.PiModelId);
            return(View(piHardware));
        }