// // GET: /Terminal/Details/5 public ViewResult Details(long id) { Guid userID = GetUserID(); saconfig_tTerminal saconfig_tterminal = db.saconfig_tTerminal.Single(s => s.ID == id && s.DataOwnerID == userID); return(View(saconfig_tterminal)); }
public ActionResult DeleteConfirmed(long id) { Guid userID = GetUserID(); saconfig_tTerminal saconfig_tterminal = db.saconfig_tTerminal.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tTerminal.DeleteObject(saconfig_tterminal); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Terminal/Edit/5 public ActionResult Edit(long id) { Guid userID = GetUserID(); saconfig_tTerminal saconfig_tterminal = db.saconfig_tTerminal.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.ConductingEqupment = new SelectList(db.saconfig_tConductingEquipment.Where(t => t.DataOwnerID == userID).ToList(), "ID", "ID", saconfig_tterminal.ConductingEqupment); ViewBag.OwnerType = new SelectList(db.saconfig_TerminalOwnerType, "ID", "OwnerType", saconfig_tterminal.OwnerType); ViewBag.TransformerWinding = new SelectList(db.saconfig_tTransformerWinding.Where(t => t.DataOwnerID == userID).ToList(), "ID", "type", saconfig_tterminal.TransformerWinding); return(View(saconfig_tterminal)); }
public ActionResult Edit(saconfig_tTerminal saconfig_tterminal) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tterminal.DataOwnerID = userID; db.saconfig_tTerminal.Attach(saconfig_tterminal); db.ObjectStateManager.ChangeObjectState(saconfig_tterminal, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ConductingEqupment = new SelectList(db.saconfig_tConductingEquipment.Where(t => t.DataOwnerID == userID).ToList(), "ID", "ID", saconfig_tterminal.ConductingEqupment); ViewBag.OwnerType = new SelectList(db.saconfig_TerminalOwnerType, "ID", "OwnerType", saconfig_tterminal.OwnerType); ViewBag.TransformerWinding = new SelectList(db.saconfig_tTransformerWinding.Where(t => t.DataOwnerID == userID).ToList(), "ID", "type", saconfig_tterminal.TransformerWinding); return(View(saconfig_tterminal)); }