// // GET: /LN0/Details/5 public ViewResult Details(long id) { Guid userID = GetUserID(); saconfig_tLN0 saconfig_tln0 = db.saconfig_tLN0.Single(s => s.ID == id && s.DataOwnerID == userID); return(View(saconfig_tln0)); }
// // GET: /LN0/Edit/5 public ActionResult Edit(long id) { Guid userID = GetUserID(); saconfig_tLN0 saconfig_tln0 = db.saconfig_tLN0.Single(s => s.ID == id && s.DataOwnerID == userID); ViewBag.LDevice = new SelectList(db.saconfig_tLDevice.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln0.LDevice); ViewBag.lnClass = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tln0.lnClass); return(View(saconfig_tln0)); }
public ActionResult DeleteConfirmed(long id) { Guid userID = GetUserID(); saconfig_tLN0 saconfig_tln0 = db.saconfig_tLN0.Single(s => s.ID == id && s.DataOwnerID == userID); db.saconfig_tLN0.DeleteObject(saconfig_tln0); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(saconfig_tLN0 saconfig_tln0) { Guid userID = GetUserID(); if (ModelState.IsValid) { saconfig_tln0.DataOwnerID = userID; db.saconfig_tLN0.Attach(saconfig_tln0); db.ObjectStateManager.ChangeObjectState(saconfig_tln0, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LDevice = new SelectList(db.saconfig_tLDevice.Where(t => t.DataOwnerID == userID).ToList(), "ID", "desc", saconfig_tln0.LDevice); ViewBag.lnClass = new SelectList(db.saconfig_tLNClassEnum.Where(t => t.DataOwnerID == userID || !t.Extension).ToList(), "ID", "value", saconfig_tln0.lnClass); return(View(saconfig_tln0)); }