public ActionResult DeleteConfirmed(long id) { tblATNodesSensorsConnection tblATNodesSensorsConnection = db.tblATNodesSensorsConnections.Find(id); db.tblATNodesSensorsConnections.Remove(tblATNodesSensorsConnection); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,node_id,sensor_id")] tblATNodesSensorsConnection tblATNodesSensorsConnection) { if (ModelState.IsValid) { db.Entry(tblATNodesSensorsConnection).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.node_id = new SelectList(db.tblATNodes, "node_id", "node_name", tblATNodesSensorsConnection.node_id); ViewBag.sensor_id = new SelectList(db.tblATSensors, "sensor_id", "sensor_type", tblATNodesSensorsConnection.sensor_id); return(View(tblATNodesSensorsConnection)); }
// GET: NodesSensorsConnections/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblATNodesSensorsConnection tblATNodesSensorsConnection = db.tblATNodesSensorsConnections.Find(id); if (tblATNodesSensorsConnection == null) { return(HttpNotFound()); } return(View(tblATNodesSensorsConnection)); }
// GET: NodesSensorsConnections/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblATNodesSensorsConnection tblATNodesSensorsConnection = db.tblATNodesSensorsConnections.Find(id); if (tblATNodesSensorsConnection == null) { return(HttpNotFound()); } ViewBag.node_id = new SelectList(db.tblATNodes, "node_id", "node_name", tblATNodesSensorsConnection.node_id); ViewBag.sensor_id = new SelectList(db.tblATSensors, "sensor_id", "sensor_type", tblATNodesSensorsConnection.sensor_id); return(View(tblATNodesSensorsConnection)); }