// // GET: /IED/Details/5 public ViewResult Details(long id /*IED id.*/, long sclID, string backURL) { Guid userID = GetUserID(); saconfig_tIED saconfig_tied = db.saconfig_tIED.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.BackURL = backURL; ViewBag.SCLID = sclID; return(View(saconfig_tied)); }
// // GET: /IED/Delete/5 public ActionResult Delete(long id, long sclID, string backURL) { Guid userID = GetUserID(); saconfig_tIED saconfig_tied = db.saconfig_tIED.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.SCLID = sclID; ViewBag.BackURL = backURL; return(View(saconfig_tied)); }
public ActionResult DeleteConfirmed(long id, long sclID, string backURL) { Guid userID = GetUserID(); saconfig_tIED saconfig_tied = db.saconfig_tIED.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tIED.DeleteObject(saconfig_tied); db.SaveChanges(); ViewBag.SCLID = sclID; ViewBag.BackURL = backURL; return(RedirectToAction("Index", new { id = sclID, backURL = backURL })); }
// // GET: /IED/Edit/5 public ActionResult Edit(long id, long sclID, string backURL) { Guid userID = GetUserID(); saconfig_tIED saconfig_tied = db.saconfig_tIED.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.SCL = new SelectList(db.saconfig_SCL.Where(t => t.DataOwnerID == userID).ToList(), "ID", "version", saconfig_tied.SCL); ViewBag.engRight = new SelectList(db.saconfig_tRightEnum, "ID", "value", saconfig_tied.engRight); ViewBag.SCLID = sclID; ViewBag.BackURL = backURL; ViewBag.OwnerType = "IED"; return(View(saconfig_tied)); }
public ActionResult Create(saconfig_tIED saconfig_tied, long sclID, string backURL) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tied.DataOwnerID = userID; saconfig_tied.SCL = sclID; db.saconfig_tIED.AddObject(saconfig_tied); db.SaveChanges(); ViewBag.SCLID = sclID; ViewBag.BackURL = backURL; return(RedirectToAction("Index", new { id = sclID, backURL = backURL })); } ViewBag.SCL = new SelectList(db.saconfig_SCL.Where(t => t.DataOwnerID == userID).ToList(), "ID", "version", saconfig_tied.SCL); ViewBag.engRight = new SelectList(db.saconfig_tRightEnum, "ID", "value", saconfig_tied.engRight); return(View(saconfig_tied)); }