// // GET: /LNode/Details/5 public ViewResult Details(long id) { Guid userID = GetUserID(); saconfig_tLNode saconfig_tlnode = db.saconfig_tLNode.Single(s => s.ID == id && s.DataOwnerID == userID); return(View(saconfig_tlnode)); }
public ActionResult DeleteConfirmed(long id) { Guid userID = GetUserID(); saconfig_tLNode saconfig_tlnode = db.saconfig_tLNode.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tLNode.DeleteObject(saconfig_tlnode); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /LNode/Edit/5 public ActionResult Edit(long id) { Guid userID = GetUserID(); saconfig_tLNode saconfig_tlnode = db.saconfig_tLNode.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.OwnerType = new SelectList(db.saconfig_NodeOwnerType, "ID", "OwnerType", saconfig_tlnode.OwnerType); ViewBag.Bay = new SelectList(db.saconfig_tBay.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.Bay); ViewBag.ConnectivityNode = new SelectList(db.saconfig_tConnectivityNode.Where(t => t.DataOwnerID == userID).ToList(), "ID", "pathName", saconfig_tlnode.ConnectivityNode); ViewBag.lnClass = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tlnode.lnClass); ViewBag.Substation = new SelectList(db.saconfig_tSubstation.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.Substation); ViewBag.VoltageLevel = new SelectList(db.saconfig_tVoltageLevel.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.VoltageLevel); return(View(saconfig_tlnode)); }
public ActionResult Edit(saconfig_tLNode saconfig_tlnode) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tlnode.DataOwnerID = userID; db.saconfig_tLNode.Attach(saconfig_tlnode); db.ObjectStateManager.ChangeObjectState(saconfig_tlnode, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OwnerType = new SelectList(db.saconfig_NodeOwnerType, "ID", "OwnerType", saconfig_tlnode.OwnerType); ViewBag.Bay = new SelectList(db.saconfig_tBay.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.Bay); ViewBag.ConnectivityNode = new SelectList(db.saconfig_tConnectivityNode.Where(t => t.DataOwnerID == userID).ToList(), "ID", "pathName", saconfig_tlnode.ConnectivityNode); ViewBag.lnClass = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tlnode.lnClass); ViewBag.Substation = new SelectList(db.saconfig_tSubstation.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.Substation); ViewBag.VoltageLevel = new SelectList(db.saconfig_tVoltageLevel.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tlnode.VoltageLevel); return(View(saconfig_tlnode)); }